fix secure cookie issue.

This commit is contained in:
Taylor Otwell 2012-04-04 10:28:06 -05:00
parent ffb4034631
commit 232bf01ae2
1 changed files with 8 additions and 0 deletions

View File

@ -68,6 +68,14 @@ public static function put($name, $value, $expiration = 0, $path = '/', $domain
$expiration = time() + ($expiration * 60); $expiration = time() + ($expiration * 60);
} }
// If the secure option is set to true, yet the request is not over HTTPS
// we'll throw an exception to let the developer know that they are
// attempting to send a secure cookie over the unsecure HTTP.
if ($secure and ! Request::secure())
{
throw new \Exception("Attempting to set secure cookie over HTTP.");
}
static::$jar[$name] = compact('name', 'value', 'expiration', 'path', 'domain', 'secure'); static::$jar[$name] = compact('name', 'value', 'expiration', 'path', 'domain', 'secure');
} }