Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5 Destroy all user sessions and force logout

Is there a way to destroy all sessions? I need to logout all users and wondering if this is possible with astrisan?

Thank you!

like image 935
Matt Avatar asked Dec 14 '22 05:12

Matt


2 Answers

it's really depend on with session drive you picked.

  • if you using file drive you can delete storage/framework/sessions path
  • if you using database drive you can delete all rows of session table,
  • if you using redis driver and also your cache driver is redis , you can run php artisan cache:clear

for any other driver you can do that like others.

like image 114
Mahdi Youseftabar Avatar answered Dec 16 '22 17:12

Mahdi Youseftabar


You can do that by deleting all files under this path

storage/framework/sessions
like image 43
hasusuf Avatar answered Dec 16 '22 19:12

hasusuf