Refactoring the cookie class.
This commit is contained in:
parent
5e28cd08b4
commit
bc51ec3d83
|
@ -56,10 +56,7 @@ public static function forever($name, $value, $path = '/', $domain = null, $secu
|
||||||
*/
|
*/
|
||||||
public static function put($name, $value, $minutes = 0, $path = '/', $domain = null, $secure = false, $http_only = false)
|
public static function put($name, $value, $minutes = 0, $path = '/', $domain = null, $secure = false, $http_only = false)
|
||||||
{
|
{
|
||||||
if ($minutes < 0)
|
if ($minutes < 0) unset($_COOKIE[$name]);
|
||||||
{
|
|
||||||
unset($_COOKIE[$name]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return setcookie($name, $value, ($minutes != 0) ? time() + ($minutes * 60) : 0, $path, $domain, $secure, $http_only);
|
return setcookie($name, $value, ($minutes != 0) ? time() + ($minutes * 60) : 0, $path, $domain, $secure, $http_only);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue