Skip to content

Instantly share code, notes, and snippets.

@TardencillaRuiz
Created January 29, 2020 16:12
Show Gist options
  • Save TardencillaRuiz/486c977d9373833bd22b07b2c63deda6 to your computer and use it in GitHub Desktop.
Save TardencillaRuiz/486c977d9373833bd22b07b2c63deda6 to your computer and use it in GitHub Desktop.
Prevent browser's back button login after logout in Laravel
public function logout(Request $request)
{
$this->guard()->logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
return $this->loggedOut($request) ?: redirect()->back();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment