Commit aed1443b authored by Taylor Otwell's avatar Taylor Otwell

cleaning up the cookie class.

parent ae544b85
...@@ -31,19 +31,18 @@ class Cookie { ...@@ -31,19 +31,18 @@ class Cookie {
{ {
if (headers_sent()) return false; if (headers_sent()) return false;
// All cookies are stored in the "jar" when set and not sent // All cookies are stored in the "jar" when set and not sent directly to
// directly to the browser. This simply makes testing all of // the browser. This simply makes testing all of the cookie stuff very
// the cookie functionality easier since the cooke jar can // easy since the jar can be inspected by the tests.
// be inspected by the developer in tests.
foreach (static::$jar as $cookie) foreach (static::$jar as $cookie)
{ {
extract($cookie); extract($cookie);
$time = ($minutes !== 0) ? time() + ($minutes * 60) : 0; $time = ($minutes !== 0) ? time() + ($minutes * 60) : 0;
// A cookie payload can't exceed 4096 bytes, so if the // A cookie payload can't exceed 4096 bytes, so if the payload is greater
// payload is greater than that, we'll raise an error // than that, we'll raise an error to warn the developer since it could
// to warn the developer. // cause serious session problems.
$value = static::sign($name, $value); $value = static::sign($name, $value);
if (strlen($value) > 4000) if (strlen($value) > 4000)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment