// Chicken/egg: Browser object doesn't exist yet.
$browser = new Horde_Core_Browser();
if ($browser->isBrowser('mozilla')) {
- session_cache_limiter('private, must-revalidate');
+ $args['session_cache_limiter'] = 'private, must-revalidate';
}
break;
}
$classname = __CLASS__;
- $registry = $GLOBALS['registry'] = new $classname($s_ctrl);
+ $registry = $GLOBALS['registry'] = new $classname($s_ctrl, $args['session_cache_limiter']);
$registry->initialApp = $app;
$appob = $registry->getApiInstance($app, 'application');
* Create a new Horde_Registry instance.
*
* @param integer $session_flags Any session flags.
+ * @param string $cache_limiter The cache limiter to use.
*
* @throws Horde_Exception
*/
- public function __construct($session_flags = 0)
+ protected function __construct($session_flags, $cache_limiter)
{
/* Define autoloader callbacks. */
$callbacks = array(
}
/* Start a session. */
+ $GLOBALS['session'] = $session = new Horde_Session();
if ($session_flags & self::SESSION_NONE ||
(PHP_SAPI == 'cli') ||
(((PHP_SAPI == 'cgi') || (PHP_SAPI == 'cgi-fcgi')) &&
empty($_SERVER['SERVER_NAME']))) {
/* Never start a session if the session flags include
SESSION_NONE. */
- $GLOBALS['session'] = $session = new Horde_Session(false);
+ $session->setup(false, $cache_limiter);
} else {
- $GLOBALS['session'] = $session = new Horde_Session();
+ $session->setup(true, $cache_limiter);
if ($session_flags & self::SESSION_READONLY) {
/* Close the session immediately so no changes can be made but
values are still available. */
/**
* Constructor.
- *
- * @param boolean $start Initiate the session?
*/
- public function __construct($start = true)
+ public function __construct()
{
$this->_lzf = Horde_Util::extensionExists('lzf');
-
- $this->setup($start);
}
/**
* Sets a custom session handler up, if there is one.
*
- * @param boolean $start Initiate the session?
+ * @param boolean $start Initiate the session?
+ * @param string $cache_limiter Override for the session cache limiter
+ * value.
*
* @throws Horde_Exception
*/
- public function setup($start = true)
+ public function setup($start = true, $cache_limiter = null)
{
- global $conf, $registry;
+ global $conf;
ini_set('url_rewriter.tags', 0);
if (empty($conf['session']['use_only_cookies'])) {
$conf['cookie']['domain'],
$conf['use_ssl'] == 1 ? 1 : 0
);
- session_cache_limiter(is_null($registry->initParams['session_cache_limiter']) ? $conf['session']['cache_limiter'] : $registry->initParams['session_cache_limiter']);
+ session_cache_limiter(is_null($cache_limiter) ? $conf['session']['cache_limiter'] : $cache_limiter);
session_name(urlencode($conf['session']['name']));
/* We want to create an instance here, not get, since we may be