Laravel 5.7 - How do I end the session if the user closes the tab or goes back to the login screen?

Asked

Viewed 328 times

0

Told me to use Session::flush(); in the loginController, however, it is not killing the session.

  • Well since I didn’t help you I’ll delete my answer, good luck with your problem!

  • After hours of solving my problem... has a class called Redirectifauthenticated inside it I added Auth::logout(); .. ```` */ public Function Handle($request, Closure $next, $Guard = null) { Auth::logout(); if (Auth:::Guard($Guard)->check()) { Reredirect('/login'); } Return $next($request); }

  • I’m new to this forum, how do I put as solved?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.