diff options
| author | Osmium Sorcerer <os@sof.beauty> | 2026-04-07 02:55:26 +0000 |
|---|---|---|
| committer | Osmium Sorcerer <os@sof.beauty> | 2026-04-18 16:52:23 +0000 |
| commit | 4bd750ca1f3e446f68e0f88fabf0682fd4d61848 (patch) | |
| tree | 055290f5f171d71bb9b2d0ec43107b30d59d7c1f /webAO/dom/setChatbox.ts | |
| parent | 085204dbdf17f379c9a32ea11660accb51b4311d (diff) | |
Replace cookies with localStorage
Cookies's use case is to store persistent data and send it to the server
in subsequent requests, such as to remember logged-in sessions. WebAO is
using them to store site settings like ad-hoc hash tables that require
parsing and serialization.
As a nasty side-effect of how cookies work, clients send all their
settings every time they connect to the server. Server has absolutely no
use for them, but each client sends them anyway, which is an
uncalled-for privacy leak.
Remove this mechanism entirely, switch to localStorage which serves
exactly the purpose of per-origin store with data that never leaves the
browser.
Diffstat (limited to 'webAO/dom/setChatbox.ts')
| -rw-r--r-- | webAO/dom/setChatbox.ts | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/webAO/dom/setChatbox.ts b/webAO/dom/setChatbox.ts index c75559d..2618292 100644 --- a/webAO/dom/setChatbox.ts +++ b/webAO/dom/setChatbox.ts @@ -1,6 +1,5 @@ import { CHATBOX, setCHATBOX } from "../client"; import chatbox_arr from "../styles/chatbox/chatboxes.js"; -import setCookie from "../utils/setCookie"; /** * Set the style of the chatbox @@ -14,7 +13,7 @@ export function setChatbox(setstyle: string) { ); setCHATBOX(themeselect.value); - setCookie("chatbox", CHATBOX); + localStorage.setItem("chatbox", CHATBOX); if (CHATBOX === "dynamic") { const style = setstyle.replace("chat", ""); if (chatbox_arr.includes(style)) { |
