From a645531674a6949b5e63a979530657b804d2f0f2 Mon Sep 17 00:00:00 2001 From: Jonas Staudenmeir Date: Thu, 28 Feb 2019 18:56:30 +0100 Subject: [PATCH] Fix cookies with falsey values --- src/Concerns/InteractsWithCookies.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Concerns/InteractsWithCookies.php b/src/Concerns/InteractsWithCookies.php index 377f4afa9..7d31162da 100644 --- a/src/Concerns/InteractsWithCookies.php +++ b/src/Concerns/InteractsWithCookies.php @@ -17,7 +17,7 @@ trait InteractsWithCookies */ public function cookie($name, $value = null, $expiry = null, array $options = []) { - if ($value) { + if (! is_null($value)) { return $this->addCookie($name, $value, $expiry, $options); } @@ -37,7 +37,7 @@ public function cookie($name, $value = null, $expiry = null, array $options = [] */ public function plainCookie($name, $value = null, $expiry = null, array $options = []) { - if ($value) { + if (! is_null($value)) { return $this->addCookie($name, $value, $expiry, $options, false); }