Exemplo n.º 1
0
 /**
  * Get value of encrypted HTTP cookie
  *
  * Return the value of an encrypted cookie from the current HTTP request,
  * or return NULL if cookie does not exist. Encrypted cookies created during
  * the current request will not be available until the next request.
  *
  * @param  string       $name
  * @return string|false
  */
 public function getEncryptedCookie($name, $deleteIfInvalid = true)
 {
     $value = \Slim\Http\Util::decodeSecureCookie($this->request->cookies($name), $this->config('cookies.secret_key'), $this->config('cookies.cipher'), $this->config('cookies.cipher_mode'));
     if ($value === false && $deleteIfInvalid) {
         $this->deleteCookie($name);
     }
     return $value;
 }