DEV Community

Cover image for Difference Between Web Storage Types

Difference Between Web Storage Types

Milecia on July 11, 2019

There's no way around working with data. Which is why you need to know the difference between the storage options you have. Some data is only used ...
Collapse
 
anpos231 profile image
anpos231

IndexedDB ?

Collapse
 
ssimontis profile image
Scott Simontis

I always view cookies as existing for the benefit of the server, not the client, since it gets passed with every request.

IndexedDB is perhaps the most exciting storage option, and it has many advantages over LocalStorage in terms of storage space, object typing, asynchronous access...the point is, check it out!

Collapse
 
odedw profile image
Oded Welgreen

Local storage is not recommended for saving authentication tokens. Cookies have the advantage of setting the 'httponly' flag, which means client side code cannot access the value. This can help mitigate the risk of some XSS attacks.
Some more information:
auth0.com/docs/security/store-tokens
owasp.org/index.php/HttpOnly

Collapse
 
ryosukehujisawa profile image
Ryosuke Hujisawa

nice

Collapse
 
hozefaj profile image
Hozefa

JSON web token?

Collapse
 
routinepoutine profile image
Matthew • Edited

The Web Storage API is easy to access, but how do you start baking cookies? Any good tutorials you would recommend?