Revision: 1042
http://mrbs.svn.sourceforge.net/mrbs/?rev=1042&view=rev
Author: jberanek
Date: 2009-03-02 14:57:54 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
* Added new config variable, $auth["session_php"]["session_expire_time"],
which sets the expiry time of the session cookie if you use the
'php' session scheme. The default value in config.inc.php is 30 days,
thereby matching the expiry time of the 'cookie' session scheme. The
previous behaviour was that sessions were not persistent - this can still
be achieved by changing the config variable to 0. Also changed the name
of session to 'MRBS_SESSID' to make it more distinct.
Modified Paths:
--------------
mrbs/trunk/web/config.inc.php
mrbs/trunk/web/session_php.inc
Modified: mrbs/trunk/web/config.inc.php
===================================================================
--- mrbs/trunk/web/config.inc.php 2009-03-02 14:30:23 UTC (rev 1041)
+++ mrbs/trunk/web/config.inc.php 2009-03-02 14:57:54 UTC (rev 1042)
@@ -294,6 +294,12 @@
$auth["session_cookie"]["include_ip"] = TRUE;
+// Configuration parameters for 'php' session scheme
+
+// The expiry time of a session, in seconds
+$auth["session_php"]["session_expire_time"] = (60*60*24*30); // 30 days
+
+
// Cookie path override. If this value is set it will be used by the
// 'php' and 'cookie' session schemes to override the default behaviour
// of automatically determining the cookie path to use
Modified: mrbs/trunk/web/session_php.inc
===================================================================
--- mrbs/trunk/web/session_php.inc 2009-03-02 14:30:23 UTC (rev 1041)
+++ mrbs/trunk/web/session_php.inc 2009-03-02 14:57:54 UTC (rev 1042)
@@ -36,7 +36,19 @@
$cookie_path = $PHP_SELF;
$cookie_path = ereg_replace('[^/]*$', '', $cookie_path);
}
-session_set_cookie_params(0, $cookie_path);
+
+global $auth;
+
+if (!isset($auth["session_php"]["session_expire_time"]))
+{
+ // Default to the behaviour of previous versions of MRBS, use only
+ // session cookies - no persistent cookie.
+ $auth["session_php"]["session_expire_time"] = 0;
+}
+
+session_set_cookie_params($auth["session_php"]["session_expire_time"],
+ $cookie_path);
+session_name("MRBS_SESSID");
session_start();
/*
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits