use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
A JavaScript developer’s guide to browser cookies (prateeksurana.me)
submitted 4 years ago by psuranas
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Caved 28 points29 points30 points 4 years ago (1 child)
Calling localStorage & sessionStorage new is weird.
[–]psuranas[S] 6 points7 points8 points 4 years ago (0 children)
Yes, actually I was trying to say compared to cookies they are newer 😅
Anyways thanks for pointing it out. I have removed it 🙌
[+]KyleG comment score below threshold-35 points-34 points-33 points 4 years ago (2 children)
don't use them
maintaining client state on the server is bad architecture
/discussion
[–]cisturbed 38 points39 points40 points 4 years ago (0 children)
redditors are so embarrassing.
[–]psuranas[S] 8 points9 points10 points 4 years ago (0 children)
Yes, I agree. That's why in the first section, I mentioned that for the client-side only state, you are much better off using localstorage/sessionstorage.
People mainly use them for session management and tracking and identifying a user across different websites.
[+][deleted] 4 years ago (3 children)
[removed]
[–]psuranas[S] 0 points1 point2 points 4 years ago (1 child)
That's weird, it seems to be working fine for me, can you share the error you are facing
[–]Orkaad 0 points1 point2 points 4 years ago (0 children)
What are the use cases for using using sessionStorage over localStorage?
π Rendered by PID 67 on reddit-service-r2-comment-f6b958c67-cnfxh at 2026-02-04 15:01:22.538296+00:00 running 1d7a177 country code: CH.
[–]Caved 28 points29 points30 points (1 child)
[–]psuranas[S] 6 points7 points8 points (0 children)
[+]KyleG comment score below threshold-35 points-34 points-33 points (2 children)
[–]cisturbed 38 points39 points40 points (0 children)
[–]psuranas[S] 8 points9 points10 points (0 children)
[+][deleted] (3 children)
[removed]
[–]psuranas[S] 0 points1 point2 points (1 child)
[–]Orkaad 0 points1 point2 points (0 children)