mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 10:31:59 -04:00
Update setcookie() for PHP8 compatibility
This commit is contained in:
parent
76cf0d296a
commit
d4707eb595
2 changed files with 4 additions and 4 deletions
|
@ -7,7 +7,7 @@ $hideDonationAlert = HttpInput::Bool(POST, 'hide-donation-alert');
|
|||
$colorScheme = HttpInput::Str(POST, 'color-scheme');
|
||||
|
||||
if($hideDonationAlert !== null){
|
||||
setcookie('hide-donation-alert', $hideDonationAlert ? 'true' : 'false', strtotime('+1 month'), '/', '', true, true);
|
||||
setcookie('hide-donation-alert', $hideDonationAlert ? 'true' : 'false', ['expires' => strtotime('+1 month'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => true, 'samesite' => 'Lax']);
|
||||
}
|
||||
|
||||
if($colorScheme !== null){
|
||||
|
@ -17,10 +17,10 @@ if($colorScheme !== null){
|
|||
|
||||
if($colorScheme == 'auto'){
|
||||
// Delete the cookie; auto is the default
|
||||
setcookie('color-scheme', '', 0, '/', '', true, true);
|
||||
setcookie('color-scheme', '', ['expires' => 0, 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => true, 'samesite' => 'Lax']);
|
||||
}
|
||||
else{
|
||||
setcookie('color-scheme', $colorScheme, strtotime('+1 year'), '/', '', true, true);
|
||||
setcookie('color-scheme', $colorScheme, ['expires' => strtotime('+1 year'), 'path' => '/', 'domain' => SITE_DOMAIN, 'secure' => true, 'httponly' => true, 'samesite' => 'Lax']);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue