diff --git a/src/Concerns/MakesHttpRequests.php b/src/Concerns/MakesHttpRequests.php index 8e7bd32..c6593b1 100644 --- a/src/Concerns/MakesHttpRequests.php +++ b/src/Concerns/MakesHttpRequests.php @@ -619,7 +619,7 @@ protected function seePlainCookie($cookieName, $value = null) * @param bool $unserialize * @return $this */ - protected function seeCookie($cookieName, $value = null, $encrypted = true, $unserialize = true) + protected function seeCookie($cookieName, $value = null, $encrypted = true, $unserialize = false) { $headers = $this->response->headers; @@ -643,6 +643,10 @@ protected function seeCookie($cookieName, $value = null, $encrypted = true, $uns $actual = $encrypted ? $this->app['encrypter']->decrypt($cookieValue, $unserialize) : $cookieValue; + $hasValidPrefix = strpos($actual, CookieValuePrefix::create($cookieName, app('encrypter')->getKey())) === 0; + + $actual = $hasValidPrefix ? CookieValuePrefix::remove($actual) : null; + $this->assertEquals( $actual, $value, "Cookie [{$cookieName}] was found, but value [{$actual}] does not match [{$value}]."