Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Fix: Wrong cookie lifetime
Browse files Browse the repository at this point in the history
Sets the cookie lifetime to zero to reset session lifetime to it's maximum with every click,
this was set to a wrong value. Also session maximum life- and idle-time is now set to
one hour by default. These settings should be configurable via an ini file in future.
In addition, the session idle-timeout controller plugin is probably no longer needed,
which would require some code cleanup.

Fixes #648: Timeout way too short and other options that need to be configurable
  • Loading branch information
fbergkemper committed May 4, 2016
1 parent bddf6e2 commit c4bab8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions config/autoload/global.php
Expand Up @@ -148,11 +148,12 @@ function read_dir_config($config, $file)
'directors' => read_dir_config($config, $file),
'service_manager' => array(
'factories' => array(
'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory',
'Zend\Session\Config\ConfigInterface' => 'Zend\Session\Service\SessionConfigFactory',
//'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory',
),
'abstract_factories' => array(
// to allow other adapters to be called by $sm->get('adaptername')
'Zend\Db\Adapter\AdapterAbstractServiceFactory',
//'Zend\Db\Adapter\AdapterAbstractServiceFactory',
),
),
'session' => array(
Expand All @@ -161,7 +162,7 @@ function read_dir_config($config, $file)
'options' => array(
'name' => 'bareos',
'use_cookies' => true,
'cookie_lifetime' => '3600',
'cookie_lifetime' => '0', // to reset lifetime to maximum at every click
'gc_maxlifetime' => '3600',
'cache_expire' => 3600,
'remember_me_seconds' => 3600,
Expand Down
Expand Up @@ -11,7 +11,7 @@ public function timeout()
{
// preparation for setting timeout via config file:
$this->getController()->getServiceLocator()->get('config');
$timeout = 600;
$timeout = 3600;

if($_SESSION['bareos']['idletime'] + $timeout > time()) {
$_SESSION['bareos']['idletime'] = time();
Expand Down

0 comments on commit c4bab8b

Please sign in to comment.