diff options
author | Jaime Pérez <jaime.perez@uninett.no> | 2016-09-27 10:41:52 +0200 |
---|---|---|
committer | Jaime Pérez <jaime.perez@uninett.no> | 2016-09-27 10:42:31 +0200 |
commit | 3fe4bb198e9a1cfdbbb7599a36526323118bfce6 (patch) | |
tree | 9346aeb6badea537fbe54d5a8431b31c769edb5c /lib/SimpleSAML/SessionHandlerPHP.php | |
parent | 5ffabc78381f2476a508c323c3984382b23da9b7 (diff) | |
download | simplesamlphp-3fe4bb198e9a1cfdbbb7599a36526323118bfce6.zip simplesamlphp-3fe4bb198e9a1cfdbbb7599a36526323118bfce6.tar.gz simplesamlphp-3fe4bb198e9a1cfdbbb7599a36526323118bfce6.tar.bz2 |
Log a warning when we notice a probable misconfiguration of PHP sessions.
This is related to #478.
Diffstat (limited to 'lib/SimpleSAML/SessionHandlerPHP.php')
-rw-r--r-- | lib/SimpleSAML/SessionHandlerPHP.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/SimpleSAML/SessionHandlerPHP.php b/lib/SimpleSAML/SessionHandlerPHP.php index 8947296..7964af7 100644 --- a/lib/SimpleSAML/SessionHandlerPHP.php +++ b/lib/SimpleSAML/SessionHandlerPHP.php @@ -51,6 +51,14 @@ class SimpleSAML_SessionHandlerPHP extends SimpleSAML_SessionHandler } if ($previous_session) { + if (session_name() === $this->cookie_name || $this->cookie_name === null) { + SimpleSAML\Logger::warning( + 'There is already a PHP session with the same name as SimpleSAMLphp\'s session, or the '. + "'session.phpsession.cookiename' configuration option is not set. Make sure to set ". + "SimpleSAMLphp's cookie name with a value not used by any other applications." + ); + } + /* * We shouldn't have a session at this point, so it might be an application session. Save the details to * retrieve it later and commit. |