Improve 2 factor usage

This commit is contained in:
Philipp 2022-06-25 14:45:33 +02:00
parent f3de8d7764
commit 0223c030a9
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
20 changed files with 400 additions and 77 deletions

View file

@ -124,6 +124,19 @@ class Cookie
}
}
/**
* Resets the cookie to a given data set
*
* @param array $data
*
* @return bool
*/
public function reset(array $data): bool
{
return $this->clear() &&
$this->setMultiple($data);
}
/**
* Clears the Friendica cookie
*/
@ -131,7 +144,7 @@ class Cookie
{
$this->data = [];
// make sure cookie is deleted on browser close, as a security measure
return $this->setCookie( '', -3600, $this->sslEnabled);
return $this->setCookie('', -3600, $this->sslEnabled);
}
/**
@ -161,7 +174,7 @@ class Cookie
*
*/
protected function setCookie(string $value = null, int $expire = null,
bool $secure = null): bool
bool $secure = null): bool
{
return setcookie(self::NAME, $value, $expire, self::PATH, self::DOMAIN, $secure, self::HTTPONLY);
}