简体   繁体   English

无法在laravel 5.3中清除会话变量

[英]Can't clear session variables in laravel 5.3

I am using laravel session class to set session variables.when i tried to clear those variables, it didn't worked. 我正在使用laravel session class设置会话变量。当我尝试清除这些变量时,它没有用。 I have used the following code to unset variables. 我使用以下代码取消设置变量。

    Auth::logout();
    Session::forget();
    Session::flush();
    session_destroy();
    unset(Session::all());

None of these code worked.any help will be appreciated... thank in advance 这些代码均无效。任何帮助将不胜感激...预先感谢

Have you tried this? 你有尝试过吗?

$request->session()->flush();

have a look here 在这里看看

have to specify sesssion key in forget method. 必须在忘记方法中指定会话密钥。 Session::forget('key');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM