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

@ -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]);
}
}

View file

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