Php sentry-注销后会话值仍然有效
为什么会这样? 这里怎么了 在注销用户之前,我将一个值放入会话变量中。 在此之后,我使用sentry的logout函数:Php sentry-注销后会话值仍然有效,php,laravel,session,cartalyst-sentry,Php,Laravel,Session,Cartalyst Sentry,为什么会这样? 这里怎么了 在注销用户之前,我将一个值放入会话变量中。 在此之后,我使用sentry的logout函数:sentry::logout() 但是注销后,我的会话变量中的值仍然有效。。为什么? 这是我的代码: Session::put('test', 1); // Log the user out Sentry::logout(); echo(Session::get('test')); exit; 我在输出中得到了1,但我什么都不期待。。。
sentry::logout()代码>
但是注销后,我的会话变量中的值仍然有效。。为什么?
这是我的代码:
Session::put('test', 1);
// Log the user out
Sentry::logout();
echo(Session::get('test'));
exit;
我在输出中得到了1
,但我什么都不期待。。。
我以为Sentry::logout()
函数会销毁所有会话数据?
这真令人困惑
编辑:
我明白了!sentry配置中的cookie名称必须与相同
在laravel的config/session.php中定义
尝试使用:
// when logging out you can use:
Auth::logout(); // or
Sentry::logout(); // (or both if you are logged in with both methods )
// if you want to Remove All Items From The Session use the following function:
Session::flush();