Skip to content
Snippets Groups Projects
Commit 36922046 authored by Tim Steiner's avatar Tim Steiner
Browse files

Update index.php to refresh cookie lifetime on each page load.

parent 5c447bc8
No related branches found
No related tags found
No related merge requests found
......@@ -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();
/*
......
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