Skip to content
Snippets Groups Projects
Commit 96721a24 authored by Olav Morken's avatar Olav Morken
Browse files

SessionHandlerPHP: Check if a key exists in the session before trying to...

SessionHandlerPHP: Check if a key exists in the session before trying to access it (in order to avoid notice-messages in the log).


git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@88 44740490-163a-0410-bde0-09ae8108e29a
parent e0a41cd5
No related branches found
No related tags found
No related merge requests found
...@@ -49,6 +49,16 @@ class SimpleSAML_SessionHandlerPHP extends SimpleSAML_SessionHandler { ...@@ -49,6 +49,16 @@ class SimpleSAML_SessionHandlerPHP extends SimpleSAML_SessionHandler {
* more information. * more information.
*/ */
public function get($key) { public function get($key) {
/* Check if key exists first to avoid notice-messages in the
* log.
*/
if(!array_key_exists($key, $_SESSION)) {
/* We should return NULL if we don't have that
* key in the session.
*/
return NULL;
}
return $_SESSION[$key]; return $_SESSION[$key];
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment