DEV Community

Discussion on: The right way to implement authentication using cookies, according to you.

Collapse
 
andrewlucker profile image
Andrew Lucker

I've seen more services using localStorage or progressive webapp magic for sessions. I think this will become more popular.

I have a hard time imagining a post-Javascript internet that still uses cookies.

Collapse
 
ben profile image
Ben Halpern

Would that be a token stored in localStorage that is used for token-based authentication via ajax?

Collapse
 
andrewlucker profile image
Andrew Lucker

Sure if you need secure access to user information from the server. Alternatively local storage can store or cache data that doesn't need to be secret.

So for example, authenticated user actions might require a token, but some information from secondary indexes might get stored client side to improve performance/reduce lookups.