Esempio n. 1
0
 public static function save()
 {
     if (self::$_sid) {
         $handler = Factory::getInstance(self::$_sessionType, self::$_config);
         if (!isset($_SESSION) || empty($_SESSION)) {
             //session清空
             $handler->destroy(self::$_sid);
         } else {
             $handler->write(self::$_sid, serialize($_SESSION));
             unset($_SESSION);
         }
         self::$_sid = null;
         self::$_config = null;
         self::$_sessionType = null;
     }
 }
Esempio n. 2
0
 /**
  * @return bool
  * @throws \Exception
  * @desc 前置控制器,session自动开启判断, 输入参数过滤
  */
 public function _before()
 {
     if (ZConfig::getField('project', 'auto_session', false)) {
         ZSession::start();
     }
     if (!empty($_POST)) {
         $_POST = $this->_filter($_POST);
     }
     if (!empty($_GET)) {
         $_GET = $this->_filter($_GET);
     }
     $params = Request::getParams();
     if (!empty($params)) {
         $params = $this->_filter($params);
         $_REQUEST = $params;
         Request::setParams($params);
     }
     return true;
 }
Esempio n. 3
0
 public function _before()
 {
     ZSession::start();
     return true;
 }