Remove last traces of date functions in favor of DateTimeImmutable

This commit is contained in:
Alex Cabal 2024-06-13 13:11:42 -05:00
parent c6d2d77537
commit 97821d0dc3
4 changed files with 7 additions and 13 deletions

View file

@ -2,8 +2,6 @@
use Ramsey\Uuid\Uuid;
use Safe\DateTimeImmutable;
use function Safe\strtotime;
/**
* @property User $User
* @property string $Url
@ -100,7 +98,7 @@ class Session{
}
public static function SetSessionCookie(string $sessionId): void{
setcookie('sessionid', $sessionId, ['expires' => strtotime('+1 week'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']); // Expires in two weeks
setcookie('sessionid', $sessionId, ['expires' => (new DateTimeImmutable('+1 week'))->format('@'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']); // Expires in two weeks
}
/**