From d8a627898eb2a06a0041129e2b90048d6f89c058 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 25 Oct 2018 16:29:53 +0300 Subject: [PATCH] Fixed fatal error if calling `$session->invalidate()` when there's no active session --- CHANGELOG.md | 6 ++++++ system/src/Grav/Framework/Session/Session.php | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 355c06136..571709661 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.5.4 +## mm/dd/2018 + +1. [](#bugfix) + * Fixed fatal error if calling `$session->invalidate()` when there's no active session + # v1.5.3 ## 10/08/2018 diff --git a/system/src/Grav/Framework/Session/Session.php b/system/src/Grav/Framework/Session/Session.php index c060345a5..f6133d336 100644 --- a/system/src/Grav/Framework/Session/Session.php +++ b/system/src/Grav/Framework/Session/Session.php @@ -229,8 +229,10 @@ class Session implements SessionInterface $params['httponly'] ); - session_unset(); - session_destroy(); + if ($this->isSessionStarted()) { + session_unset(); + session_destroy(); + } $this->started = false;