简体   繁体   中英

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. 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');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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