Merge pull request #1210 from SamBrishes/patch-008

Allow removing Session & Cookie Entries
This commit is contained in:
Diego Najar 2020-06-23 20:00:47 +02:00 committed by GitHub
commit d11c26e91c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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]);
}
}