Skip to content

Commit

Permalink
Make sure the set cookie doesn't contain null
Browse files Browse the repository at this point in the history
If it does we don't want to throw an exception but just return the null
value
  • Loading branch information
StijnVrolijk committed May 8, 2019
1 parent 5cc8233 commit 130a3fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spoon/cookie/cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public static function get($key)
}

// unserialize failed
if($actualValue === null && json_encode(false) != $value) throw new SpoonCookieException('The value of the cookie "' . $key . '" could not be retrieved. This might indicate that it has been tampered with OR the cookie was initially not set using SpoonCookie.');
if($actualValue === null && json_encode(null) !== $value) throw new SpoonCookieException('The value of the cookie "' . $key . '" could not be retrieved. This might indicate that it has been tampered with OR the cookie was initially not set using SpoonCookie.');

// everything is fine
return $actualValue;
Expand Down

0 comments on commit 130a3fb

Please sign in to comment.