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

SessionHandler: Remove version check for PHP >= 5.2 when calling setcookie.

Since 5.2.0 is now the minimum supported version, this check is no longer
necessary.

Thanks to Ryan Panning for providing this patch.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3060 44740490-163a-0410-bde0-09ae8108e29a
parent 62ad00cf
No related branches found
No related tags found
No related merge requests found
......@@ -150,13 +150,7 @@ abstract class SimpleSAML_SessionHandler {
$expire = time() + $params['lifetime'];;
}
$version = explode('.', PHP_VERSION);
if ((int)$version[0] === 5 && (int)$version[1] < 2) {
$success = setcookie($name, $value, $expire, $params['path'], $params['domain'], $params['secure']);
} else {
$success = setcookie($name, $value, $expire, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
}
if (!$success) {
if (!setcookie($name, $value, $expire, $params['path'], $params['domain'], $params['secure'], $params['httponly'])) {
throw new SimpleSAML_Error_Exception('Error setting cookie - headers already sent.');
}
}
......
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