#1249 patch to make session.php more reliable

XOOPS_2.6.x
open
nobody
None
1
2013-01-25
2013-01-25
Alain91
No

Index: session.php

--- session.php (revision 596)
+++ session.php (working copy)
@@ -258,6 +258,6 @@
$session_name = ($xoops->getConfig('use_mysession') && $xoops->getConfig('session_name') != '') ? $xoops->getConfig('session_name') : session_name();
$session_expire = !is_null($expire) ? intval($expire) : (($xoops->getConfig('use_mysession') && $xoops->getConfig('session_name') != '') ? $xoops->getConfig('session_expire') * 60 : ini_get("session.cookie_lifetime"));
$session_id = empty($sess_id) ? session_id() : $sess_id;
- setcookie($session_name, $session_id, $session_expire ? time() + $session_expire : 0, '/', XOOPS_COOKIE_DOMAIN, 0);
+ if (!headers_sent()) setcookie($session_name, $session_id, $session_expire ? time() + $session_expire : 0, '/', XOOPS_COOKIE_DOMAIN, 0);
}
}
\ No newline at end of file

Discussion


Log in to post a comment.