Skip to content

Commit

Permalink
Fix error in logout (#9189)
Browse files Browse the repository at this point in the history
session_destroy(): Trying to destroy uninitialized session
  • Loading branch information
murrant committed Sep 12, 2018
1 parent 4abd849 commit f32e095
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/Listeners/AuthEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ public function logout(Logout $event)
{
DB::table('authlog')->insert(['user' => $event->user->username ?: '', 'address' => Request::ip(), 'result' => 'Logged Out']);

if (!isset($_SESSION)) {
session_start();
}
@session_start();
unset($_SESSION['authenticated']);
session_destroy();
}
Expand Down

0 comments on commit f32e095

Please sign in to comment.