diff options
Diffstat (limited to 'lib/SimpleSAML/Session.php')
-rw-r--r-- | lib/SimpleSAML/Session.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php index 6ab6834..153478a 100644 --- a/lib/SimpleSAML/Session.php +++ b/lib/SimpleSAML/Session.php @@ -377,6 +377,23 @@ class SimpleSAML_Session } } + + /** + * Save the current session and clean any left overs that could interfere with the normal application behaviour. + * + * Use this method if you are using PHP sessions in your application *and* in SimpleSAMLphp, *after* you are done + * using SimpleSAMLphp and before trying to access your application's session again. + */ + public function cleanup() + { + $this->save(); + $sh = SimpleSAML_SessionHandler::getSessionHandler(); + if ($sh instanceof SimpleSAML_SessionHandlerPHP) { + $sh->restorePrevious(); + } + } + + /** * Mark this session as dirty. * |