[Cs-content-commits] SF.net SVN: cs-content:[485] trunk/1.0/cs_session.class.php
PHP Templating & Includes System
Brought to you by:
crazedsanity
|
From: <cra...@us...> - 2011-01-06 01:16:55
|
Revision: 485
http://cs-content.svn.sourceforge.net/cs-content/?rev=485&view=rev
Author: crazedsanity
Date: 2011-01-06 01:16:49 +0000 (Thu, 06 Jan 2011)
Log Message:
-----------
Create session ID from cookie, if available.
/cs_session.class.php:
* __construct():
-- set defaults for $sessName & $sessionId.
-- use session name from $_COOKIE, with the constant 'SESSION_NAME'.
Modified Paths:
--------------
trunk/1.0/cs_session.class.php
Modified: trunk/1.0/cs_session.class.php
===================================================================
--- trunk/1.0/cs_session.class.php 2010-09-01 14:03:03 UTC (rev 484)
+++ trunk/1.0/cs_session.class.php 2011-01-06 01:16:49 UTC (rev 485)
@@ -24,14 +24,26 @@
*/
function __construct($createSession=true) {
parent::__construct(true);
+ $sessName = null;
+ $sessionId = null;
if($createSession) {
if(is_string($createSession) && strlen($createSession) >2) {
+ $sessName = $createSession;
session_name($createSession);
}
+ elseif(constant('SESSION_NAME') && isset($_COOKIE) && isset($_COOKIE[constant('SESSION_NAME')])) {
+ $sessName = constant('SESSION_NAME');
+ session_name(constant('SESSION_NAME'));
+ $sessionId = $_COOKIE[constant('SESSION_NAME')];
+ session_id($sessionId);
+ }
//now actually create the session.
@session_start();
}
+ if(is_null($sessName)) {
+ $sessName = session_name();
+ }
//check if there's a uid in the session already.
//TODO: need a setting somewhere that says what the name of this var should be,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|