當我使用按鈕註銷時,我更新用戶表中的屬性(isActive)。一切都有效,除非一生結束。 爲什麼?After LifeTime - Session.php自動註銷
使用此數據是完全信息。所以一個簡單的發展不僅僅是好的。
謝謝
session.php文件
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => 120,
'expire_on_close' => false,
AuthenticateUsers.php
public function logout(Request $request)
{
User::where('id', Auth::user()->id)->update(['isActive' => '0']);
$this->guard()->logout();
$request->session()->invalidate();
return redirect('/login');
}
非常感謝,很好的解釋! 對不起,我的英語...... –