From d0e809a32cd58c0d89b2425aeb245e04a94df7d6 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 6 Dec 2015 08:23:53 -0500 Subject: Add new method to flush session variables --- app/Core/Session/SessionStorage.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'app/Core/Session/SessionStorage.php') diff --git a/app/Core/Session/SessionStorage.php b/app/Core/Session/SessionStorage.php index 11230793..f55a7ee3 100644 --- a/app/Core/Session/SessionStorage.php +++ b/app/Core/Session/SessionStorage.php @@ -61,6 +61,21 @@ class SessionStorage return $session; } + /** + * Flush session data + * + * @access public + */ + public function flush() + { + $session = get_object_vars($this); + unset($session['storage']); + + foreach (array_keys($session) as $property) { + unset($this->$property); + } + } + /** * Copy class properties to external storage * -- cgit v1.2.3