From 1eb956fdf5b5be05347128284881b861395e75a6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 25 Nov 2008 19:36:02 +0000 Subject: [PATCH] "- do not send session data for clients doing no sessions to memcached - use 10min session lifetime for GroupDAV as for anonymous sessions" --- phpgwapi/inc/class.egw_session_memcache.inc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.egw_session_memcache.inc.php b/phpgwapi/inc/class.egw_session_memcache.inc.php index 4fac5a9a4a..51c7339e20 100644 --- a/phpgwapi/inc/class.egw_session_memcache.inc.php +++ b/phpgwapi/inc/class.egw_session_memcache.inc.php @@ -106,7 +106,7 @@ class egw_session_memcache * According to a commentary on php.net (session_set_save_handler) this function has to return * a string, if the session-id is NOT found, not false. Returning false terminates the script * with a fatal error! - * + * * @param string $id * @return string|boolean false on error, '' for not found session otherwise session data */ @@ -137,8 +137,13 @@ class egw_session_memcache { $lifetime = (int)ini_get('session.gc_maxlifetime'); + if ($id == 'no-session') + { + return true; // no need to save + } // give anon sessions only a lifetime of 10min - if (is_object($GLOBALS['egw']->session) && $GLOBALS['egw']->session->session_flags == 'A') + if (is_object($GLOBALS['egw']->session) && $GLOBALS['egw']->session->session_flags == 'A' || + $GLOBALS['egw_info']['flags']['currentapp'] == 'groupdav') { $lifetime = 600; }