--- ../0.7.4/config.inc.php	2011-03-03 02:26:11.565256656 +0100
+++ ../config.inc.php	2011-03-11 21:57:11.855624358 +0100
@@ -35,15 +35,17 @@
     require_once 'utils/authenticate.php';
     require_once 'utils/helper.php';
 
+    session_cache_limiter('private');
+    if (isset($_COOKIE['WEBCAL_EXPIRE'])) {
+        $expire = $_COOKIE['WEBCAL_EXPIRE'];
+        session_cache_expire($expire);
+        unset($_COOKIE['WEBCAL_EXPIRE']);
+        setcookie('WEBCAL_EXPIRE', FALSE);
+    }
+    else
+        session_cache_expire(TIMEOUT);
     session_start();
-
-    if (isset($_SESSION['user_settings']))
-        $timeout = $_SESSION['user_settings']->getTimeout();
-
-    if (isset($timeout))
-        ini_set('session.gc_maxlifetime', $timeout);
-    else if (defined('TIMEOUT'))
-        ini_set('session.gc_maxlifetime', TIMEOUT);
+    $_SESSION['WEB_ROOT'] = WEB_ROOT;
 
     error_reporting(E_ALL ^ E_NOTICE ^ E_USER_NOTICE);
 
@@ -69,4 +71,11 @@
         ini_set('log_errors', 'on');
         ini_set('error_log', LOG_FILE);
     }
-?>
+
+    if (! isset($_SESSION['isTimeout'])) {
+    	if (isset($_SESSION['user_settings']))
+        	$_SESSION['user_settings']->isTimeout();
+    }
+    else
+	unset($_SESSION['isTimeout']);
+?>
\ No newline at end of file
