Allow to remove Session & Cookie Items

Allow to remove Session & Cookie Items
This commit is contained in:
SamBrishes 2020-06-16 00:32:08 +02:00
parent e3abd64fe4
commit bcbfe55e24
2 changed files with 13 additions and 1 deletions

View file

@ -21,9 +21,14 @@ class Cookie {
setcookie($key, $value, $expire); setcookie($key, $value, $expire);
} }
public static function remove($key)
{
unset($_COOKIE[$key]);
setcookie($key, null, time()-3600);
}
public static function isEmpty($key) public static function isEmpty($key)
{ {
return empty($_COOKIE[$key]); return empty($_COOKIE[$key]);
} }
} }

View file

@ -73,4 +73,11 @@ class Session {
} }
return false; return false;
} }
public static function remove($key)
{
$key = 's_'.$key;
unset($_SESSION[$key]);
}
} }