Beispiel #1
0
 /**
  * 设置前缀 
  * 
  * @param string $url
  * @access public
  * @return void
  */
 public static function setPrefix($url)
 {
     self::$_prefix = md5($url);
 }
Beispiel #2
0
 public function setSession($data, $sessionId, $timeout = 86400)
 {
     $sessionUtil = new Util_Session();
     $serializeText = $sessionUtil->serialize($data);
     $this->redis->setex("MMTRIX_SESSION_" . $sessionId, $timeout, $serializeText);
 }
Beispiel #3
0
 public function check($code, $key = '')
 {
     $key = $this->authcode($this->seKey) . $key;
     // 验证码不能为空
     $secode = Util_Session::get($key);
     if (empty($code) || empty($secode)) {
         return false;
     }
     // session 过期
     if ($this->_nowTime->timeStamp - $secode['verify_time'] > $this->expire) {
         Util_Session::delete($key);
         return false;
     }
     if ($this->authcode(strtoupper($code)) == $secode['verify_code']) {
         $this->reset && Util_Session::delete($key);
         return true;
     }
     return false;
 }