]>
git.immae.eu Git - github/shaarli/Shaarli.git/blob - application/security/CookieManager.php
cde4746e864d4d3991a983fc50a7c76a8609a675
3 declare(strict_types
=1);
5 namespace Shaarli\Security
;
9 /** @var string Name of the cookie set after logging in **/
10 public const STAY_SIGNED_IN
= 'shaarli_staySignedIn';
12 /** @var mixed $_COOKIE set by reference */
15 public function __construct(array &$cookies)
17 $this->cookies
= $cookies;
20 public function setCookieParameter(string $key, string $value, int $expires, string $path): self
22 $this->cookies
[$key] = $value;
24 setcookie($key, $value, $expires, $path);
29 public function getCookieParameter(string $key, string $default = null): ?string
31 return $this->cookies
[$key] ?? $default;