diff --git a/document_root/index.php b/document_root/index.php
index f58645847f9743713b0c22378d598e3dec7961ff..13e27a805a269beef980be97f833272dea8af9e7 100644
--- a/document_root/index.php
+++ b/document_root/index.php
@@ -16,7 +16,13 @@ if ($pearPath) {
     set_include_path(get_include_path() . PATH_SEPARATOR . $pearPath);
 }
 
-Zend_Session::setOptions($config->session->toArray());
+$sessionConfig = $config->session->toArray();
+$sessionConfig['cookie_path'] = $config->application->baseUrl;
+Zend_Session::setOptions($sessionConfig);
+Zend_Session::start();
+if (count($_SESSION) > 0) {
+    setcookie(session_name(), $_COOKIE[session_name()], time() + ini_get('session.cookie_lifetime'), $config->application->baseUrl);
+}
 
 $cache = Zend_Cache::factory(
     'Core',
@@ -26,8 +32,6 @@ $cache = Zend_Cache::factory(
 );
 Zend_Registry::set('cache', $cache);
 
-Zend_Session::start();
-
 $db = Zend_Db::factory($config->database);
 $db->query('SET NAMES utf8');
 Zend_Registry::set('db', $db);
@@ -39,7 +43,7 @@ $layout->setLayoutPath(MODULES_DIR . '/default/views/scripts');
 
 $front = Zend_Controller_Front::getInstance();
 $front->addModuleDirectory(MODULES_DIR);
-$front->setBaseUrl('/~tsteiner/CREQ3');
+$front->setBaseUrl($config->application->baseUrl);
 $front->dispatch();
 
 /*