Skip to content

Wallos: Open-source, self-hostable personal subscription tracker. Visualize your recurring expenses, manage your budget, and save money.

fix: service worker precaching logout.php causes user to be logged out

Miguel Ribeiro8b0325c7d3c6
diff --git a/endpoints/subscriptions/get.php b/endpoints/subscriptions/get.php
index 0eacce5..c0a0fda 100644
--- a/endpoints/subscriptions/get.php
+++ b/endpoints/subscriptions/get.php
@@ -146,19 +146,8 @@ if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {
}
}
- if ($sort === "price") {
- usort($subscriptions, function ($a, $b) {
- return $a['price'] < $b['price'] ? 1 : -1;
- });
- if ($settings['disabledToBottom'] === 'true') {
- usort($print, function ($a, $b) {
- return $a['inactive'] - $b['inactive'];
- });
- }
- }
-
if (isset($print)) {
- printSubscriptions($print, $sort, $categories, $members, $i18n, $colorTheme, "../../");
+ printSubscriptions($print, $sort, $categories, $members, $i18n, $colorTheme, "../../", $settings['disabledToBottom']);
}
if (count($subscriptions) == 0) {
diff --git a/endpoints/user/save_user.php b/endpoints/user/save_user.php
index 51a3e71..0cf574a 100644
--- a/endpoints/user/save_user.php
+++ b/endpoints/user/save_user.php
@@ -291,7 +291,11 @@ if (
$oldLanguage = isset($_COOKIE['language']) ? $_COOKIE['language'] : "en";
$root = str_replace('/endpoints/user', '', dirname($_SERVER['PHP_SELF']));
$root = $root == '' ? '/' : $root;
- setcookie('language', $language, $cookieExpire, $root);
+ setcookie('language', $language, [
+ 'path' => $root,
+ 'expires' => $cookieExpire,
+ 'samesite' => 'Strict'
+ ]);
$_SESSION['avatar'] = $avatar;
$_SESSION['main_currency'] = $main_currency;
diff --git a/includes/getsettings.php b/includes/getsettings.php
index 7def7ee..0710eb4 100644
--- a/includes/getsettings.php
+++ b/includes/getsettings.php
@@ -11,7 +11,10 @@ if ($settings) {
$themeMapping = array(0 => 'light', 1 => 'dark', 2 => 'automatic');
$themeKey = isset($settings['dark_theme']) ? $settings['dark_theme'] : 2;
$themeValue = $themeMapping[$themeKey];
- setcookie('theme', $themeValue, $cookieExpire);
+ setcookie('theme', $themeValue, [
+ 'expires' => $cookieExpire,
+ 'samesite' => 'Strict'
+ ]);
$settings['update_theme_setttings'] = false;
if (isset($_COOKIE['inUseTheme']) && $settings['dark_theme'] == 2) {
$inUseTheme = $_COOKIE['inUseTheme'];
diff --git a/includes/list_subscriptions.php b/includes/list_subscriptions.php
index a19ab03..c3794bd 100644
--- a/includes/list_subscriptions.php
+++ b/includes/list_subscriptions.php
@@ -1,9 +1,10 @@
<?php
- require_once 'i18n/getlang.php';
+require_once 'i18n/getlang.php';
- function getBillingCycle($cycle, $frequency, $i18n) {
- switch ($cycle) {
+function getBillingCycle($cycle, $frequency, $i18n)
+{
+ switch ($cycle) {
case 1:
return $frequency == 1 ? translate('Daily', $i18n) : $frequency . " " . translate('days', $i18n);
case 2:
@@ -12,13 +13,14 @@
return $frequency == 1 ? translate('Monthly', $i18n) : $frequency . " " . translate('months', $i18n);
case 4:
return $frequency == 1 ? translate('Yearly', $i18n) : $frequency . " " . translate('years', $i18n);
- }
}
+}
- function getPricePerMonth($cycle, $frequency, $price) {
- switch ($cycle) {
+function getPricePerMonth($cycle, $frequency, $price)
+{
+ switch ($cycle) {
case 1:
- $numberOfPaymentsPerMonth = (30 / $frequency);
+ $numberOfPaymentsPerMonth = (30 / $frequency);
return $price * $numberOfPaymentsPerMonth;
case 2:
$numberOfPaymentsPerMonth = (4.35 / $frequency);
@@ -29,137 +31,160 @@
case 4:
$numberOfMonths = (12 * $frequency);
return $price / $numberOfMonths;
- }
}
+}
+
+
+function getPriceConverted($price, $currency, $database)
+{
+ $query = "SELECT rate FROM currencies WHERE id = :currency";
+ $stmt = $database->prepare($query);
+ $stmt->bindParam(':currency', $currency, SQLITE3_INTEGER);
+ $result = $stmt->execute();
+
+ $exchangeRate = $result->fetchArray(SQLITE3_ASSOC);
+ if ($exchangeRate === false) {
+ return $price;
+ } else {
+ $fromRate = $exchangeRate['rate'];
+ return $price / $fromRate;
+ }
+}
-
- function getPriceConverted($price, $currency, $database) {
- $query = "SELECT rate FROM currencies WHERE id = :currency";
- $stmt = $database->prepare($query);
- $stmt->bindParam(':currency', $currency, SQLITE3_INTEGER);
- $result = $stmt->execute();
-
- $exchangeRate = $result->fetchArray(SQLITE3_ASSOC);
- if ($exchangeRate === false) {
- return $price;
- } else {
- $fromRate = $exchangeRate['rate'];
- return $price / $fromRate;
+function printSubscriptions($subscriptions, $sort, $categories, $members, $i18n, $colorTheme, $imagePath, $disabledToBottom)
+{
+ if ($sort === "price") {
+ usort($subscriptions, function ($a, $b) {
+ return $a['price'] < $b['price'] ? 1 : -1;
+ });
+ if ($disabledToBottom === 'true') {
+ usort($subscriptions, function ($a, $b) {
+ return $a['inactive'] - $b['inactive'];
+ });
}
}
- function printSubscriptions($subscriptions, $sort, $categories, $members, $i18n, $colorTheme, $imagePath) {
- $currentCategory = 0;
- $currentPayerUserId = 0;
- $currentPaymentMethodId = 0;
- foreach ($subscriptions as $subscription) {
- if ($sort == "category_id" && $subscription['category_id'] != $currentCategory) {
- ?>
- <div class="subscription-list-title">
- <?php
- if ($subscription['category_id'] == 1) {
- echo translate('no_category', $i18n);
- } else {
- echo $categories[$subscription['category_id']]['name'];
- }
- ?>
- </div>
+ $currentCategory = 0;
+ $currentPayerUserId = 0;
+ $currentPaymentMethodId = 0;
+ foreach ($subscriptions as $subscription) {
+ if ($sort == "category_id" && $subscription['category_id'] != $currentCategory) {
+ ?>
+ <div class="subscription-list-title">
<?php
- $currentCategory = $subscription['category_id'];
- }
- if ($sort == "payer_user_id" && $subscription['payer_user_id'] != $currentPayerUserId) {
+ if ($subscription['category_id'] == 1) {
+ echo translate('no_category', $i18n);
+ } else {
+ echo $categories[$subscription['category_id']]['name'];
+ }
?>
- <div class="subscription-list-title">
- <?= $members[$subscription['payer_user_id']]['name'] ?>
- </div>
- <?php
- $currentPayerUserId = $subscription['payer_user_id'];
- }
- if ($sort == "payment_method_id" && $subscription['payment_method_id'] != $currentPaymentMethodId) {
- ?>
- <div class="subscription-list-title">
- <?= $subscription['payment_method_name'] ?>
- </div>
- <?php
- $currentPaymentMethodId = $subscription['payment_method_id'];
- }
+ </div>
+ <?php
+ $currentCategory = $subscription['category_id'];
+ }
+ if ($sort == "payer_user_id" && $subscription['payer_user_id'] != $currentPayerUserId) {
+ ?>
+ <div class="subscription-list-title">
+ <?= $members[$subscription['payer_user_id']]['name'] ?>
+ </div>
+ <?php
+ $currentPayerUserId = $subscription['payer_user_id'];
+ }
+ if ($sort == "payment_method_id" && $subscription['payment_method_id'] != $currentPaymentMethodId) {
+ ?>
+ <div class="subscription-list-title">
+ <?= $subscription['payment_method_name'] ?>
+ </div>
+ <?php
+ $currentPaymentMethodId = $subscription['payment_method_id'];
+ }
?>
- <div class="subscription<?= $subscription['inactive'] ? ' inactive' : '' ?>" onClick="toggleOpenSubscription(<?= $subscription['id'] ?>)" data-id="<?= $subscription['id'] ?>" data-name="<?= $subscription['name'] ?>">
- <div class="subscription-main">
- <span class="logo">
- <?php
- if ($subscription['logo'] != "") {
- ?>
- <img src="<?= $subscription['logo'] ?>">
- <?php
- } else {
- include $imagePath . "images/siteicons/svg/logo.php";
- }
- ?>
- </span>
- <span class="name"><?= $subscription['name'] ?></span>
- <span class="cycle"><?= $subscription['billing_cycle'] ?></span>
- <span class="next"><?= $subscription['next_payment'] ?></span>
- <span class="price">
- <img src="<?= $subscription['payment_method_icon'] ?>" title="<?= translate('payment_method', $i18n) ?>: <?= $subscription['payment_method_name'] ?>"/>
- <?= CurrencyFormatter::format($subscription['price'], $subscription['currency_code']) ?>
- </span>
- <button type="button" class="actions-expand" onClick="expandActions(event, <?= $subscription['id'] ?>)">
- <i class="fas fa-ellipsis-v"></i>
- </button>
- <ul class="actions">
- <li class="edit" title="<?= translate('edit_subscription', $i18n) ?>" onClick="openEditSubscription(event, <?= $subscription['id'] ?>)">
- <?php include $imagePath . "images/siteicons/svg/edit.php"; ?>
- <?= translate('edit_subscription', $i18n) ?>
- </li>
- <li class="delete" title="<?= translate('delete', $i18n) ?>" onClick="deleteSubscription(event, <?= $subscription['id'] ?>)">
- <?php include $imagePath . "images/siteicons/svg/delete.php"; ?>
- <?= translate('delete', $i18n) ?>
- </li>
- <li class="clone" title="<?= translate('clone', $i18n) ?>" onClick="cloneSubscription(event, <?= $subscription['id'] ?>)">
- <?php include $imagePath . "images/siteicons/svg/clone.php"; ?>
- <?= translate('clone', $i18n) ?>
- </li>
- </ul>
- </div>
- <div class="subscription-secondary">
- <span class="name"><?php include $imagePath . "images/siteicons/svg/subscription.php"; ?><?= $subscription['name'] ?></span>
- <span class="payer_user" title="<?= translate('paid_by', $i18n) ?>"><?php include $imagePath . "images/siteicons/svg/payment.php"; ?><?= $members[$subscription['payer_user_id']]['name'] ?></span>
- <span class="category" title="<?= translate('category', $i18n) ?>" ><?php include $imagePath . "images/siteicons/svg/category.php"; ?><?= $categories[$subscription['category_id']]['name'] ?></span>
+ <div class="subscription<?= $subscription['inactive'] ? ' inactive' : '' ?>"
+ onClick="toggleOpenSubscription(<?= $subscription['id'] ?>)" data-id="<?= $subscription['id'] ?>"
+ data-name="<?= $subscription['name'] ?>">
+ <div class="subscription-main">
+ <span class="logo">
<?php
- if ($subscription['url'] != "") {
- $url = $subscription['url'];
- if (!preg_match('/^https?:\/\//', $url)) {
- $url = "https://" . $url;
- }
- ?>
- <span class="url" title="<?= translate('external_url', $i18n) ?>"><a href="<?= $url ?>" target="_blank"><?php include $imagePath . "images/siteicons/svg/web.php"; ?></a></span>
- <?php
- }
- ?>
- </div>
- <?php
- if ($subscription['notes'] != "") {
+ if ($subscription['logo'] != "") {
?>
- <div class="subscription-notes">
- <span class="notes">
- <?php include $imagePath . "images/siteicons/svg/notes.php"; ?>
- <?= $subscription['notes'] ?>
- </span>
- </div>
+ <img src="<?= $subscription['logo'] ?>">
<?php
+ } else {
+ include $imagePath . "images/siteicons/svg/logo.php";
}
- ?>
+ ?>
+ </span>
+ <span class="name"><?= $subscription['name'] ?></span>
+ <span class="cycle"><?= $subscription['billing_cycle'] ?></span>
+ <span class="next"><?= $subscription['next_payment'] ?></span>
+ <span class="price">
+ <img src="<?= $subscription['payment_method_icon'] ?>"
+ title="<?= translate('payment_method', $i18n) ?>: <?= $subscription['payment_method_name'] ?>" />
+ <?= CurrencyFormatter::format($subscription['price'], $subscription['currency_code']) ?>
+ </span>
+ <button type="button" class="actions-expand" onClick="expandActions(event, <?= $subscription['id'] ?>)">
+ <i class="fas fa-ellipsis-v"></i>
+ </button>
+ <ul class="actions">
+ <li class="edit" title="<?= translate('edit_subscription', $i18n) ?>"
+ onClick="openEditSubscription(event, <?= $subscription['id'] ?>)">
+ <?php include $imagePath . "images/siteicons/svg/edit.php"; ?>
+ <?= translate('edit_subscription', $i18n) ?>
+ </li>
+ <li class="delete" title="<?= translate('delete', $i18n) ?>"
+ onClick="deleteSubscription(event, <?= $subscription['id'] ?>)">
+ <?php include $imagePath . "images/siteicons/svg/delete.php"; ?>
+ <?= translate('delete', $i18n) ?>
+ </li>
+ <li class="clone" title="<?= translate('clone', $i18n) ?>"
+ onClick="cloneSubscription(event, <?= $subscription['id'] ?>)">
+ <?php include $imagePath . "images/siteicons/svg/clone.php"; ?>
+ <?= translate('clone', $i18n) ?>
+ </li>
+ </ul>
</div>
+ <div class="subscription-secondary">
+ <span
+ class="name"><?php include $imagePath . "images/siteicons/svg/subscription.php"; ?><?= $subscription['name'] ?></span>
+ <span class="payer_user"
+ title="<?= translate('paid_by', $i18n) ?>"><?php include $imagePath . "images/siteicons/svg/payment.php"; ?><?= $members[$subscription['payer_user_id']]['name'] ?></span>
+ <span class="category"
+ title="<?= translate('category', $i18n) ?>"><?php include $imagePath . "images/siteicons/svg/category.php"; ?><?= $categories[$subscription['category_id']]['name'] ?></span>
+ <?php
+ if ($subscription['url'] != "") {
+ $url = $subscription['url'];
+ if (!preg_match('/^https?:\/\//', $url)) {
+ $url = "https://" . $url;
+ }
+ ?>
+ <span class="url" title="<?= translate('external_url', $i18n) ?>"><a href="<?= $url ?>"
+ target="_blank"><?php include $imagePath . "images/siteicons/svg/web.php"; ?></a></span>
+ <?php
+ }
+ ?>
+ </div>
+ <?php
+ if ($subscription['notes'] != "") {
+ ?>
+ <div class="subscription-notes">
+ <span class="notes">
+ <?php include $imagePath . "images/siteicons/svg/notes.php"; ?>
+ <?= $subscription['notes'] ?>
+ </span>
+ </div>
+ <?php
+ }
+ ?>
+ </div>
<?php
- }
}
+}
- $query = "SELECT main_currency FROM user WHERE id = :userId";
- $stmt = $db->prepare($query);
- $stmt->bindValue(':userId', $userId, SQLITE3_INTEGER);
- $result = $stmt->execute();
- $row = $result->fetchArray(SQLITE3_ASSOC);
- $mainCurrencyId = $row['main_currency'];
+$query = "SELECT main_currency FROM user WHERE id = :userId";
+$stmt = $db->prepare($query);
+$stmt->bindValue(':userId', $userId, SQLITE3_INTEGER);
+$result = $stmt->execute();
+$row = $result->fetchArray(SQLITE3_ASSOC);
+$mainCurrencyId = $row['main_currency'];
?>
\ No newline at end of file
diff --git a/includes/version.php b/includes/version.php
index dc38058..7ba8249 100644
--- a/includes/version.php
+++ b/includes/version.php
@@ -1,3 +1,3 @@
<?php
-$version = "v2.21.1";
+$version = "v2.21.2";
?>
\ No newline at end of file
diff --git a/index.php b/index.php
index b35fa6d..1f2e46b 100644
--- a/index.php
+++ b/index.php
@@ -289,19 +289,8 @@ $headerClass = count($subscriptions) > 0 ? "main-actions" : "main-actions hidden
}
}
- if ($sort === "price") {
- usort($subscriptions, function ($a, $b) {
- return $a['price'] < $b['price'] ? 1 : -1;
- });
- if ($settings['disabledToBottom'] === 'true') {
- usort($print, function ($a, $b) {
- return $a['inactive'] - $b['inactive'];
- });
- }
- }
-
if (isset($print)) {
- printSubscriptions($print, $sort, $categories, $members, $i18n, $colorTheme, "");
+ printSubscriptions($print, $sort, $categories, $members, $i18n, $colorTheme, "", $settings['disabledToBottom']);
}
$db->close();
diff --git a/login.php b/login.php
index df63847..7dcdb87 100644
--- a/login.php
+++ b/login.php
@@ -51,16 +51,25 @@ if ($adminRow['login_disabled'] == 1) {
$_SESSION['main_currency'] = $main_currency;
$_SESSION['userId'] = $userId;
$cookieExpire = time() + (30 * 24 * 60 * 60);
- setcookie('language', $language, $cookieExpire);
+ setcookie('language', $language, [
+ 'expires' => $cookieExpire,
+ 'samesite' => 'Strict'
+ ]);
$query = "SELECT color_theme FROM settings";
$stmt = $db->prepare($query);
$result = $stmt->execute();
$settings = $result->fetchArray(SQLITE3_ASSOC);
- setcookie('colorTheme', $settings['color_theme'], $cookieExpire);
+ setcookie('colorTheme', $settings['color_theme'], [
+ 'expires' => $cookieExpire,
+ 'samesite' => 'Strict'
+ ]);
$cookieValue = $username . "|" . "abc123ABC" . "|" . $main_currency;
- setcookie('wallos_login', $cookieValue, $cookieExpire);
+ setcookie('wallos_login', $cookieValue, [
+ 'expires' => $cookieExpire,
+ 'samesite' => 'Strict'
+ ]);
$db->close();
header("Location: .");
@@ -118,14 +127,20 @@ if (isset($_POST['username']) && isset($_POST['password'])) {
$_SESSION['main_currency'] = $main_currency;
$_SESSION['userId'] = $userId;
$cookieExpire = time() + (30 * 24 * 60 * 60);
- setcookie('language', $language, $cookieExpire);
+ setcookie('language', $language, [
+ 'expires' => $cookieExpire,
+ 'samesite' => 'Strict'
+ ]);
if ($rememberMe) {
$query = "SELECT color_theme FROM settings";
$stmt = $db->prepare($query);
$result = $stmt->execute();
$settings = $result->fetchArray(SQLITE3_ASSOC);
- setcookie('colorTheme', $settings['color_theme'], $cookieExpire);
+ setcookie('colorTheme', $settings['color_theme'], [
+ 'expires' => $cookieExpire,
+ 'samesite' => 'Strict'
+ ]);
$token = bin2hex(random_bytes(32));
$addLoginTokens = "INSERT INTO login_tokens (user_id, token) VALUES (:userId, :token)";
@@ -135,7 +150,10 @@ if (isset($_POST['username']) && isset($_POST['password'])) {
$addLoginTokensStmt->execute();
$_SESSION['token'] = $token;
$cookieValue = $username . "|" . $token . "|" . $main_currency;
- setcookie('wallos_login', $cookieValue, $cookieExpire);
+ setcookie('wallos_login', $cookieValue, [
+ 'expires' => $cookieExpire,
+ 'samesite' => 'Strict'
+ ]);
}
$db->close();
header("Location: .");
diff --git a/scripts/common.js b/scripts/common.js
index f76aee0..f681dcb 100644
--- a/scripts/common.js
+++ b/scripts/common.js
@@ -8,9 +8,9 @@ function toggleDropdown() {
function showErrorMessage(message) {
const toast = document.querySelector(".toast#errorToast");
- (closeIcon = document.querySelector(".close-error")),
- (errorMessage = document.querySelector(".errorMessage")),
- (progress = document.querySelector(".progress.error"));
+ const closeIcon = document.querySelector(".close-error");
+ const errorMessage = document.querySelector(".errorMessage");
+ const progress = document.querySelector(".progress.error");
let timer1, timer2;
errorMessage.textContent = message;
toast.classList.add("active");
@@ -39,9 +39,9 @@ function showErrorMessage(message) {
function showSuccessMessage(message) {
const toast = document.querySelector(".toast#successToast");
- (closeIcon = document.querySelector(".close-success")),
- (successMessage = document.querySelector(".successMessage")),
- (progress = document.querySelector(".progress.success"));
+ const closeIcon = document.querySelector(".close-success");
+ const successMessage = document.querySelector(".successMessage");
+ const progress = document.querySelector(".progress.success");
let timer1, timer2;
successMessage.textContent = message;
toast.classList.add("active");
@@ -76,7 +76,7 @@ document.addEventListener('DOMContentLoaded', function () {
const darkThemeCss = document.querySelector("#dark-theme");
darkThemeCss.disabled = themePreference === 'light';
document.body.className = themePreference;
- document.cookie = `inUseTheme=${themePreference}; expires=Fri, 31 Dec 9999 23:59:59 GMT`;
+ document.cookie = `inUseTheme=${themePreference}; expires=Fri, 31 Dec 9999 23:59:59 GMT; SameSite=Strict`;
const themeColorMetaTag = document.querySelector('meta[name="theme-color"]');
themeColorMetaTag.setAttribute('content', themePreference === 'dark' ? '#222222' : '#FFFFFF');
}
diff --git a/scripts/dashboard.js b/scripts/dashboard.js
index 32ca264..beef96f 100644
--- a/scripts/dashboard.js
+++ b/scripts/dashboard.js
@@ -337,7 +337,7 @@ function setSortOption(sortOption) {
const expirationDate = new Date();
expirationDate.setDate(expirationDate.getDate() + daysToExpire);
const cookieValue = encodeURIComponent(sortOption) + '; expires=' + expirationDate.toUTCString();
- document.cookie = 'sortOrder=' + cookieValue;
+ document.cookie = 'sortOrder=' + cookieValue + '; SameSite=Strict';
fetchSubscriptions();
toggleSortOptions();
}
diff --git a/scripts/registration.js b/scripts/registration.js
index 442ba73..df386e4 100644
--- a/scripts/registration.js
+++ b/scripts/registration.js
@@ -5,7 +5,7 @@ function setCookie(name, value, days) {
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toUTCString();
}
- document.cookie = name + "=" + value + expires;
+ document.cookie = name + "=" + value + expires + "; SameSite=Strict";
}
function storeFormFieldValue(fieldId) {
diff --git a/scripts/theme.js b/scripts/theme.js
index cfe63cd..6ff1c6b 100644
--- a/scripts/theme.js
+++ b/scripts/theme.js
@@ -3,7 +3,7 @@ function switchTheme() {
darkThemeCss.disabled = !darkThemeCss.disabled;
const themeChoice = darkThemeCss.disabled ? 'light' : 'dark';
- document.cookie = `theme=${themeChoice}; expires=Fri, 31 Dec 9999 23:59:59 GMT`;
+ document.cookie = 'theme=' + themeValue + '; expires=Fri, 31 Dec 9999 23:59:59 GMT; SameSite=Strict';
document.body.className = themeChoice;
@@ -60,7 +60,7 @@ function setDarkTheme(theme) {
lightThemeButton.classList.remove('selected');
automaticThemeButton.classList.remove('selected');
- document.cookie = `theme=${themeValue}; expires=Fri, 31 Dec 9999 23:59:59 GMT`;
+ document.cookie = `theme=${themeValue}; expires=Fri, 31 Dec 9999 23:59:59 GMT; SameSite=Strict`;
if (theme == 0) {
darkThemeCss.disabled = true;
@@ -78,7 +78,7 @@ function setDarkTheme(theme) {
darkThemeCss.disabled = !prefersDarkMode;
document.body.className = prefersDarkMode ? 'dark' : 'light';
automaticThemeButton.classList.add('selected');
- document.cookie = `inUseTheme=${prefersDarkMode ? 'dark' : 'light'}; expires=Fri, 31 Dec 9999 23:59:59 GMT`;
+ document.cookie = `inUseTheme=${prefersDarkMode ? 'dark' : 'light'}; expires=Fri, 31 Dec 9999 23:59:59 GMT; SameSite=Strict`;
}
showSuccessMessage(data.message);
@@ -129,7 +129,7 @@ function setTheme(themeColor) {
targetLabel.classList.add('is-selected');
}
- document.cookie = `colorTheme=${themeColor}; expires=Fri, 31 Dec 9999 23:59:59 GMT`;
+ document.cookie = `colorTheme=${themeColor}; expires=Fri, 31 Dec 9999 23:59:59 GMT; SameSite=Strict`;
fetch('endpoints/settings/colortheme.php', {
method: 'POST',
diff --git a/service-worker.js b/service-worker.js
index 673dbb8..231b9a8 100644
--- a/service-worker.js
+++ b/service-worker.js
@@ -8,7 +8,6 @@ self.addEventListener('install', function (event) {
'settings.php',
'stats.php',
'about.php',
- 'logout.php',
'login.php',
'admin.php',
'endpoints/subscriptions/get.php',