diff --git a/src/Cookie.php b/src/Cookie.php index a489711..7af40ab 100644 --- a/src/Cookie.php +++ b/src/Cookie.php @@ -89,6 +89,8 @@ class Cookie { list($hash, $value) = explode('|', $_COOKIE[$key], 2); if (! $this->isSecure($hash, $value)) { + $this->delete($key); + throw new Exception\CookieInvalidSecureHashException("Invalid cookie hash value given."); } diff --git a/src/Exception/CookieInvalidSecureHashException.php b/src/Exception/CookieInvalidSecureHashException.php index 53187dd..6a63a4a 100644 --- a/src/Exception/CookieInvalidSecureHashException.php +++ b/src/Exception/CookieInvalidSecureHashException.php @@ -1,5 +1,5 @@