Example #1
0
 public final function sign(SetCookie $setCookie, Key $key) : SetCookie
 {
     $value = $setCookie->getValue();
     $hmac = hash_hmac($this->getAlgorithm(), $value, $key->toString());
     $value = $hmac . $value;
     return new SetCookie($setCookie->getName(), $value, $setCookie->expiresAt(), $setCookie->getPath(), $setCookie->getDomain(), $setCookie->isSecure(), $setCookie->isHttpOnly());
 }