示例#1
0
 protected function sendCookie()
 {
     $key = Dee::$app->request->cookieValidationKey;
     foreach ($this->_cookies as $name => $value) {
         list($value, $expire) = $value;
         $value = Helper::hashData($value, $key);
         setcookie($name, $value, $expire);
     }
 }
示例#2
0
 public function init()
 {
     if ($this->cookieValidationKey === null) {
         $this->cookieValidationKey = Helper::getRandomKey('request.validationKey');
     }
     foreach ($_COOKIE as $name => $value) {
         if (is_string($value) && ($data = Helper::validateData($value, $this->cookieValidationKey) !== false)) {
             $this->_cookies[$name] = $data;
         }
     }
 }