User now can use test endpoints

This commit is contained in:
Pablo Ferreiro 2022-06-28 20:41:51 +02:00
parent 9acc40618a
commit bc3777d74c
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
8 changed files with 48 additions and 24 deletions

View file

@ -23,6 +23,10 @@ class Cookies {
return isset($_COOKIE[$name]);
}
static public function check(string $name, string $value): bool {
return self::exists($name) && $_COOKIE[$name] === $value;
}
static public function set(string $name, string $value) {
setcookie($name, $value, time()+60*60*24*30, '/', '', isset($_SERVER['HTTPS']), true);
}