3 ms·
They're not the same thing. Cookies add state to HTTP which is very useful, compared to LocalStorage which is really just client-side storage that can also be u
by manigandham 11y ago
They're not the same thing. Cookies add state to HTTP which is very useful, compared to LocalStorage which is really just client-side storage that can also be used to store state but at the higher web application level rather than HTTP.
- sandstrom 11y agoIf you need state you typically use JS + XHR and can set your own headers. Cookies are just header values with some predefined behaviour wrapped around them.
- manigandham 11y agoSure, which again means it's on a web application level rather than working at the HTTP level. There are lots of uses for cookies without having JS or a full browser available.