From c442f822fb9b961f7a92930e572edb52159391d3 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 8 Nov 2012 20:22:34 +0100 Subject: Simplify keep-alive action. Now the interval is based on session_lifetime, which means it's executed only if needed for session keeping (reset interval on every action). Temporarily remove check-recent request, it will be replaced by new global system refresh request in future. Use keep_alive setting as auto-refresh request interval (allow no-refresh mode) --- program/include/rcube.php | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'program/include/rcube.php') diff --git a/program/include/rcube.php b/program/include/rcube.php index 0e40b3c6b..9c1a6d84a 100644 --- a/program/include/rcube.php +++ b/program/include/rcube.php @@ -434,6 +434,9 @@ class rcube $this->session->register_gc_handler(array($this, 'temp_gc')); $this->session->register_gc_handler(array($this, 'cache_gc')); + $this->session->set_secret($this->config->get('des_key') . dirname($_SERVER['SCRIPT_NAME'])); + $this->session->set_ip_check($this->config->get('ip_check')); + // start PHP session (if not in CLI mode) if ($_SERVER['REMOTE_ADDR']) { session_start(); @@ -441,33 +444,6 @@ class rcube } - /** - * Configure session object internals - */ - public function session_configure() - { - if (!$this->session) { - return; - } - - $lifetime = $this->config->get('session_lifetime', 0) * 60; - $keep_alive = $this->config->get('keep_alive'); - - // set keep-alive/check-recent interval - if ($keep_alive) { - // be sure that it's less than session lifetime - if ($lifetime) { - $keep_alive = min($keep_alive, $lifetime - 30); - } - $keep_alive = max(60, $keep_alive); - $this->session->set_keep_alive($keep_alive); - } - - $this->session->set_secret($this->config->get('des_key') . dirname($_SERVER['SCRIPT_NAME'])); - $this->session->set_ip_check($this->config->get('ip_check')); - } - - /** * Garbage collector function for temp files. * Remove temp files older than two days -- cgit v1.2.3