diff options
author | till <till@php.net> | 2008-02-13 05:26:47 +0000 |
---|---|---|
committer | till <till@php.net> | 2008-02-13 05:26:47 +0000 |
commit | 2912dbd2c22220d657e5d5d9935f91c09b1103a4 (patch) | |
tree | b1a9cf01885c797923b7044e77cd6ef798cb71e3 /program | |
parent | aec82bd9401abe260384248477be9d864b247ac9 (diff) |
* implemented feature from #1484476
Diffstat (limited to 'program')
-rw-r--r-- | program/include/main.inc | 5 | ||||
-rw-r--r-- | program/include/session.inc | 10 |
2 files changed, 12 insertions, 3 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index 9e33bae69..2d28090c7 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -57,6 +57,11 @@ function rcmail_startup($task='mail') // load configuration $CONFIG = rcmail_load_config(); + // set session domain + if (isset($CONFIG['session_domain']) && !empty($CONFIG['session_domain'])) { + ini_set('session.cookie_domain', $CONFIG['session_domain']); + } + // set session garbage collecting time according to session_lifetime if (!empty($CONFIG['session_lifetime'])) ini_set('session.gc_maxlifetime', ($CONFIG['session_lifetime']) * 120); diff --git a/program/include/session.inc b/program/include/session.inc index a29eabba9..9becacf00 100644 --- a/program/include/session.inc +++ b/program/include/session.inc @@ -172,9 +172,13 @@ function sess_regenerate_id() sess_destroy(session_id()); session_id($random); - $cookie = session_get_cookie_params(); - setcookie(session_name(), "", time() - 3600); - setcookie(session_name(), $random, $cookie['lifetime'] ? time() + $cookie['lifetime'] : 0, $cookie['path']); + + $cookie = session_get_cookie_params(); + $_lifetime = $cookie['lifetime'] ? time() + $cookie['lifetime'] : 0; + + setcookie(session_name(), '', time() - 3600); + setcookie(session_name(), $random, $_lifetime, $cookie['path'], + $cookie['domain']); return true; } |