mirror of
https://github.com/friendica/friendica
synced 2025-04-25 09:10:11 +00:00
Improve 2 factor usage
This commit is contained in:
parent
f3de8d7764
commit
0223c030a9
20 changed files with 400 additions and 77 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue