mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 15:20:32 -04:00
Fix broken Unix timestamp formatting
This commit is contained in:
parent
d1901970a5
commit
6af2717773
3 changed files with 4 additions and 4 deletions
|
@ -98,7 +98,7 @@ class Session{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function SetSessionCookie(string $sessionId): void{
|
public static function SetSessionCookie(string $sessionId): void{
|
||||||
setcookie('sessionid', $sessionId, ['expires' => (new DateTimeImmutable('+1 week'))->format('@'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']); // Expires in two weeks
|
setcookie('sessionid', $sessionId, ['expires' => (new DateTimeImmutable('+1 week'))->format('U'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']); // Expires in two weeks
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -60,7 +60,7 @@ try{
|
||||||
|
|
||||||
// Increment local download count, expires in 2 weeks
|
// Increment local download count, expires in 2 weeks
|
||||||
$downloadCount++;
|
$downloadCount++;
|
||||||
setcookie('download-count', (string)$downloadCount, ['expires' => (new DateTimeImmutable('+2 week'))->format('@'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']);
|
setcookie('download-count', (string)$downloadCount, ['expires' => (new DateTimeImmutable('+2 week'))->format('U'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => false, 'samesite' => 'Lax']);
|
||||||
}
|
}
|
||||||
catch(Exceptions\InvalidFileException | Exceptions\EbookNotFoundException){
|
catch(Exceptions\InvalidFileException | Exceptions\EbookNotFoundException){
|
||||||
Template::Emit404();
|
Template::Emit404();
|
||||||
|
|
|
@ -3,7 +3,7 @@ $hideDonationAlert = HttpInput::Bool(POST, 'hide-donation-alert');
|
||||||
$colorScheme = HttpInput::Str(POST, 'color-scheme');
|
$colorScheme = HttpInput::Str(POST, 'color-scheme');
|
||||||
|
|
||||||
if($hideDonationAlert !== null){
|
if($hideDonationAlert !== null){
|
||||||
setcookie('hide-donation-alert', $hideDonationAlert ? 'true' : 'false', ['expires' => (new DateTimeImmutable('+1 month'))->format('@'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => true, 'samesite' => 'Lax']);
|
setcookie('hide-donation-alert', $hideDonationAlert ? 'true' : 'false', ['expires' => (new DateTimeImmutable('+1 month'))->format('U'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => true, 'samesite' => 'Lax']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($colorScheme !== null){
|
if($colorScheme !== null){
|
||||||
|
@ -16,7 +16,7 @@ if($colorScheme !== null){
|
||||||
setcookie('color-scheme', '', ['expires' => 0, 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => true, 'samesite' => 'Lax']);
|
setcookie('color-scheme', '', ['expires' => 0, 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => true, 'samesite' => 'Lax']);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
setcookie('color-scheme', $colorScheme, ['expires' => (new DateTimeImmutable('+1 year'))->format('@'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => true, 'samesite' => 'Lax']);
|
setcookie('color-scheme', $colorScheme, ['expires' => (new DateTimeImmutable('+1 year'))->format('U'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => true, 'samesite' => 'Lax']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue