Allow to remove Session & Cookie Items
Allow to remove Session & Cookie Items
This commit is contained in:
parent
e3abd64fe4
commit
bcbfe55e24
2 changed files with 13 additions and 1 deletions
|
@ -20,10 +20,15 @@ class Cookie {
|
|||
$expire = time()+60*60*24*$daysToExpire;
|
||||
setcookie($key, $value, $expire);
|
||||
}
|
||||
|
||||
public static function remove($key)
|
||||
{
|
||||
unset($_COOKIE[$key]);
|
||||
setcookie($key, null, time()-3600);
|
||||
}
|
||||
|
||||
public static function isEmpty($key)
|
||||
{
|
||||
return empty($_COOKIE[$key]);
|
||||
}
|
||||
|
||||
}
|
|
@ -73,4 +73,11 @@ class Session {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function remove($key)
|
||||
{
|
||||
$key = 's_'.$key;
|
||||
|
||||
unset($_SESSION[$key]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue