From 6aa1bec4b61f912d264f6308534fe8c9c8781252 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Thu, 6 Mar 2008 16:41:52 +0000
Subject: [PATCH] Using assert() code in session handler. And using default
 value from getValue form configuration

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@371 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/SessionHandler.php | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/lib/SimpleSAML/SessionHandler.php b/lib/SimpleSAML/SessionHandler.php
index 7b236ee48..19ae8d58b 100644
--- a/lib/SimpleSAML/SessionHandler.php
+++ b/lib/SimpleSAML/SessionHandler.php
@@ -99,24 +99,9 @@ abstract class SimpleSAML_SessionHandler {
 		assert($config instanceof SimpleSAML_Configuration);
 
 		/* Get the session handler option from the configuration. */
-		$handler = $config->getValue('session.handler');
+		$handler = $config->getValue('session.handler', 'phpsession');
 
-		/* If 'session.handler' is NULL or unset, then we want
-		 * to fall back to the default PHP session handler.
-		 */
-		if(is_null($handler)) {
-			$handler = 'phpsession';
-		}
-
-
-		/* The session handler must be a string. */
-		if(!is_string($handler)) {
-			$e = 'Invalid setting for the \'session.handler\'' .
-			     ' configuration option. This option should be' .
-			     ' set to a valid string.';
-			error_log($e);
-			die($e);
-		}
+		assert('is_string($handler)');
 
 		$handler = strtolower($handler);
 
-- 
GitLab