Add new method to flush session variables

This commit is contained in:
Frederic Guillot
2015-12-06 08:23:53 -05:00
parent 9bd7985ba4
commit d0e809a32c
3 changed files with 38 additions and 1 deletions

View File

@@ -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
*