Exemplo n.º 1
0
 /**
  * @param Cookie $cookie
  * @return Cookie
  */
 private function encodeCookie(Cookie $cookie)
 {
     if ($this->httpConfig->cookieProtection() == HttpConfig::COOKIE_ENCRYPT) {
         return $cookie->withValue($this->encrypter()->encrypt($cookie->getValue()));
     }
     //VALUE.HMAC
     return $cookie->withValue($cookie->getValue() . $this->hmacSign($cookie->getValue()));
 }
Exemplo n.º 2
0
 /**
  * @param Cookie $cookie
  * @return Cookie
  */
 private function encodeCookie(Cookie $cookie)
 {
     if ($this->config['method'] == self::ENCRYPT) {
         return $cookie->withValue($this->encrypter()->encrypt($cookie->getValue()));
     }
     //MAC
     return $cookie->withValue($cookie->getValue() . $this->hmacSign($cookie->getValue()));
 }