Skip to content

Commit

Permalink
- Add option to set session name (#1486433)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Nov 13, 2011
1 parent 95ebcd9 commit bd34cad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================


- Add option to set session name (#1486433)
- Add option to skip alternative email addresses in autocompletion - Add option to skip alternative email addresses in autocompletion
- Fix inconsistent behaviour of Compose button in Drafts folder, add Edit button for drafts - Fix inconsistent behaviour of Compose button in Drafts folder, add Edit button for drafts
- Fix problem with parsing HTML message body with non-unicode characters (#1487813) - Fix problem with parsing HTML message body with non-unicode characters (#1487813)
Expand Down
3 changes: 3 additions & 0 deletions config/main.inc.php.dist
Expand Up @@ -222,6 +222,9 @@ $rcmail_config['session_lifetime'] = 10;
// session domain: .example.org // session domain: .example.org
$rcmail_config['session_domain'] = ''; $rcmail_config['session_domain'] = '';


// session name. Default: 'roundcube_sessid'
$rcmail_config['session_name'] = null;

// Backend to use for session storage. Can either be 'db' (default) or 'memcache' // Backend to use for session storage. Can either be 'db' (default) or 'memcache'
// If set to memcache, a list of servers need to be specified in 'memcache_hosts' // If set to memcache, a list of servers need to be specified in 'memcache_hosts'
// Make sure the Memcache extension (http://pecl.php.net/package/memcache) version >= 2.0.0 is installed // Make sure the Memcache extension (http://pecl.php.net/package/memcache) version >= 2.0.0 is installed
Expand Down
11 changes: 7 additions & 4 deletions program/include/rcmail.php
Expand Up @@ -678,18 +678,21 @@ public function session_init()
if (session_id()) if (session_id())
return; return;


$sess_name = $this->config->get('session_name');
$sess_domain = $this->config->get('session_domain');
$lifetime = $this->config->get('session_lifetime', 0) * 60;

// set session domain // set session domain
if ($domain = $this->config->get('session_domain')) { if ($sess_domain) {
ini_set('session.cookie_domain', $domain); ini_set('session.cookie_domain', $sess_domain);
} }
// set session garbage collecting time according to session_lifetime // set session garbage collecting time according to session_lifetime
$lifetime = $this->config->get('session_lifetime', 0) * 60;
if ($lifetime) { if ($lifetime) {
ini_set('session.gc_maxlifetime', $lifetime * 2); ini_set('session.gc_maxlifetime', $lifetime * 2);
} }


ini_set('session.cookie_secure', rcube_https_check()); ini_set('session.cookie_secure', rcube_https_check());
ini_set('session.name', 'roundcube_sessid'); ini_set('session.name', $sess_name ? $sess_name : 'roundcube_sessid');
ini_set('session.use_cookies', 1); ini_set('session.use_cookies', 1);
ini_set('session.use_only_cookies', 1); ini_set('session.use_only_cookies', 1);
ini_set('session.serialize_handler', 'php'); ini_set('session.serialize_handler', 'php');
Expand Down

0 comments on commit bd34cad

Please sign in to comment.