瀏覽代碼

Modify timeout 3 Min

stanley-king 9 年之前
父節點
當前提交
0e9510649e
共有 1 個文件被更改,包括 2 次插入6 次删除
  1. 2 6
      helper/session.php

+ 2 - 6
helper/session.php

@@ -11,7 +11,7 @@ class session
     static $stInstance = NULL;
     private $fdestroy = false;
 
-    const sid_expire = 10000;
+    const sid_expire = 3;
     const prefix = 'PHPSESSID';
     const session_name = 'PHPSESSID';
 
@@ -74,7 +74,6 @@ class session
     public function onRead($rsid)
     {
         //Log::record("onRead sid={$rsid}",Log::DEBUG);
-
         $sid = $_COOKIE[self::session_name];
         if(empty($sid) || $sid != $rsid)
         {
@@ -104,7 +103,6 @@ class session
     }
 
     public function onClose() {
-//        Log::record("onClose",Log::DEBUG);
         return true;
     }
 
@@ -112,19 +110,17 @@ class session
         if($this->fdestroy) {
             dcache($sid,self::prefix);
         } else {
-            $ret = wcache($sid,array(self::session_name => $data),self::prefix,self::sid_expire);
+            wcache($sid,array(self::session_name => $data),self::prefix,self::sid_expire);
         }
 
         return true;
     }
 
     public function onDestroy($sid) {
-//        Log::record("onDestroy sid={$sid}",Log::DEBUG);
         return dcache($sid,self::prefix);
     }
 
     public function onGc($expire) {
-//        Log::record("onGc expire={$expire}",Log::DEBUG);
         return true;
     }
 }