tweaking code and adding comments.

This commit is contained in:
Taylor Otwell
2011-09-21 22:45:50 -05:00
parent 1c9798e980
commit 766fa9831a
3 changed files with 24 additions and 50 deletions

View File

@@ -83,7 +83,9 @@ class Cookie {
if ($minutes < 0) unset($_COOKIE[$name]);
$time = ($minutes != 0) ? time() + ($minutes * 60) : 0;
// Since PHP needs the cookie lifetime in seconds, we will calculate it here.
// A "0" lifetime means the cookie expires when the browser closes.
$time = ($minutes !== 0) ? time() + ($minutes * 60) : 0;
return setcookie($name, $value, $time, $path, $domain, $secure, $http_only);
}