diff --git a/src/Concerns/InteractsWithCookies.php b/src/Concerns/InteractsWithCookies.php index d012eade6..cd5dcbeef 100644 --- a/src/Concerns/InteractsWithCookies.php +++ b/src/Concerns/InteractsWithCookies.php @@ -78,7 +78,9 @@ public function plainCookie($name, $value = null, $expiry = null, array $options public function addCookie($name, $value, $expiry = null, array $options = [], $encrypt = true) { if ($encrypt) { - $value = encrypt($value, $serialize = false); + $prefix = CookieValuePrefix::create($name, Crypt::getKey()); + + $value = encrypt($prefix.$value, $serialize = false); } if ($expiry instanceof DateTimeInterface) {