我使用Laravel 4.2。我不知道我的代码有什么问题,导致它记得登录用户,即使我在尝试函数中设置为false。有人能帮我吗?
public function login()
{
//
$input['username']=Input::get("username", "");
$input['password']=Input::get("password", "");
if (Auth::attempt(array('username' => $input['username'], 'password' => $input['password']), false))
{
return Redirect::to('/');
//return Redirect::intended('dashboard');
}else{
$messages="Incorrect username or password!";
return Redirect::back()->withInput()->with('messages', $messages);
}
}
浏览器关闭设置
'expire_on_close' => true,
on app/config/session.php
file
For remember me- default为false。当你设置它为true,它应该创建一个新的会话,如果一个不存在(即它已经过期)。
所以在正常情况下,在一定时间后会话到期。但如果'expire_on_close'
是真的,你就能完成你的工作。