News for hackers. Stuff that matters.
Re:Edison Bulb Night Mode by adaml_623 on Saturday November 04, 2023 @04:48AM (#38139208)
Regarding the local storage Vs server side defaults I don't understand why you wouldn't use a web cookie to store the on/off state? Am I missing something
Re:Edison Bulb Night Mode by speps on Saturday November 04, 2023 @04:58AM (#38139259)
A lot of people have forgotten that cookies aren't just for session id and can store anything. The browser also sends them all in the initial GET request. So yes you're right, it could have been done server-side for the 2nd visit.

Also, because of cookie banners, they got a bad reputation even though most countries allow you to store non personal data. Even just data that is necessary for the functionality of the website doesn't need permission.

Re:Edison Bulb Night Mode by globular-toast on Saturday November 04, 2023 @06:08AM (#38139585)
That requires a dynamic backend, though. A lot of people use static site generators for their blogs these days. Otherwise you're absolutely right and this is a perfect use for a cookie.
Re:Edison Bulb Night Mode by petemilly on Monday November 06, 2023 @07:23AM (#38161606)
Setting a cookie is a good idea—I honestly just didn't think of it. I created a todo for myself to explore that whenever I can get around to it.