Artisan command for clearing all session data in Laravel

前端 未结 9 1124
北荒
北荒 2021-02-04 02:16

What is the artisan command for clearing all session data in Laravel, I\'m looking for something like:

$ php artisan session:clear

But apparent

9条回答
  •  忘掉有多难
    2021-02-04 02:51

    An easy way to get rid of all sessions is to change the name of the session cookie. This can be easily done by changing the 'cookie' => '...' line in config/session.php file.

    This works independently of the session storage you use and also won't touch any other data except the session data (and thus seems preferable over the renewing the app key solution to me, where you would loose any encrypted data stored in the app).

提交回复
热议问题