Add DateTimeFormat enum

This commit is contained in:
Alex Cabal 2024-11-08 16:41:15 -06:00
parent be5574eaec
commit c35c47b793
18 changed files with 38 additions and 26 deletions

View file

@ -98,7 +98,7 @@ class Session{
public static function SetSessionCookie(string $sessionId): void{
/** @throws void */
setcookie('sessionid', $sessionId, ['expires' => intval((new DateTimeImmutable('+1 week'))->format('U')), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']); // Expires in two weeks
setcookie('sessionid', $sessionId, ['expires' => intval((new DateTimeImmutable('+1 week'))->format(Enums\DateTimeFormat::UnixTimestamp->value)), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']); // Expires in two weeks
}
/**