|
@@ -75,17 +75,18 @@ class session
|
|
}
|
|
}
|
|
public function onRead($rsid)
|
|
public function onRead($rsid)
|
|
{
|
|
{
|
|
- //Log::record("onRead sid={$rsid}",Log::DEBUG);
|
|
|
|
$sid = $_COOKIE[self::session_name];
|
|
$sid = $_COOKIE[self::session_name];
|
|
- //if(empty($sid) || $sid != $rsid)
|
|
|
|
if(empty($sid))
|
|
if(empty($sid))
|
|
{
|
|
{
|
|
$ret = session_regenerate_id(false);
|
|
$ret = session_regenerate_id(false);
|
|
if($ret) {
|
|
if($ret) {
|
|
- dcache($rsid,self::prefix);
|
|
|
|
- $rsid = session_id();
|
|
|
|
|
|
+ if(!empty($sid)) {
|
|
|
|
+ dcache($sid,self::prefix);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $sid = session_id();
|
|
$this->expire_time = time() + self::expire_min * 60;
|
|
$this->expire_time = time() + self::expire_min * 60;
|
|
- fcgi_setcookie("PHPSESSID","{$rsid}",$this->expire_time);
|
|
|
|
|
|
+ fcgi_setcookie("PHPSESSID","{$sid}",$this->expire_time);
|
|
}
|
|
}
|
|
|
|
|
|
return '';
|
|
return '';
|
|
@@ -94,11 +95,11 @@ class session
|
|
{
|
|
{
|
|
$data = rcache($sid,self::prefix,self::session_name);
|
|
$data = rcache($sid,self::prefix,self::session_name);
|
|
if(empty($data)) {
|
|
if(empty($data)) {
|
|
- dcache($rsid,self::prefix);
|
|
|
|
|
|
+ dcache($sid,self::prefix);
|
|
session_regenerate_id(false);
|
|
session_regenerate_id(false);
|
|
- $rsid = session_id();
|
|
|
|
|
|
+ $sid = session_id();
|
|
$this->expire_time = time() + self::expire_min * 60;
|
|
$this->expire_time = time() + self::expire_min * 60;
|
|
- fcgi_setcookie("PHPSESSID","{$rsid}",$this->expire_time);
|
|
|
|
|
|
+ fcgi_setcookie("PHPSESSID","{$sid}",$this->expire_time);
|
|
|
|
|
|
return '';
|
|
return '';
|
|
} else {
|
|
} else {
|