From f2b96ef53208c266f0c4f48851e4530f0f833221 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Thu, 29 Mar 2012 09:02:39 +0000
Subject: [PATCH] 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
---
 lib/SimpleSAML/SessionHandler.php | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/lib/SimpleSAML/SessionHandler.php b/lib/SimpleSAML/SessionHandler.php
index 684e49bb7..ad136e904 100644
--- a/lib/SimpleSAML/SessionHandler.php
+++ b/lib/SimpleSAML/SessionHandler.php
@@ -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.');
 		}
 	}
-- 
GitLab