Contents
The cookie values the browser gets are meaningless without proper decryption. With encryption, the server becomes the sole source of truth for HTTP cookies. HTTP cookies are a server concern and a simple way to persist temporary data on the browser.
Is session storage encrypted?
Encrypted data storage SessionStorage is part of the same API as localStorage and also offers key/value-based storage. SessionStorage is associated with an origin and a set of browsing contexts. The origin-isolated storage pattern offers a way to keep data out of reach of malicious code.
What’s the difference between session ID cookies and encrypted cookies?
The difference is that session id cookies are in themselves meaningless because they do not represent any meaningful information, while the encrypted cookie is meaningless because the client does not possess the ability to decrypt the data.
Which is better encrypted cookies or plain cookies?
Encrypted cookies are fundamentally more complex: they’re larger in size, they require a complex algorithm, they require that algorithm to be correctly implemented, they do contain actual data and are thereby worth attacking, they do require the management of a secret key. They’re also harder to revoke due to their decentralised nature.
Session id cookies are plain simple: a meaningless random id merely referring to data stored elsewhere. The only vulnerability* is guessability, which is easy enough to prevent by increasing the length and rotating and expiring ids.
Not sure which is more secure because after reading a little about the internals of node-client-sessions, there are a lot of potential attack vectors that need to be accounted for, and I’m not sure how much they account for. For example, they account for a timing attack by using a constantTime algorithm in one place.