4 ms·
> Aside from that, what the heck is so important that folks need to cookie that can't be just tied to the session token in the backend? literally any functiona
by masukomi 4y ago
> Aside from that, what the heck is so important that folks need to cookie that can't be just tied to the session token in the backend?
literally any functionality that needs to persist state and you want to use offline and between reloads? See also Progressive Web Apps (PWAs).
- guenthert 4y agoYou can store the state in the URL, can you not? That used to be done anyhow.
- pseudosavant 4y agoI have written a web app that does this so you can share links which have the same state. You can't have that long of URLs actually - especially for some browsers. Having to base64 encode most/all of it so you can safely use any kind of data makes it even worse. My use case was very basic and I quickly hit limits that made it so I couldn't "persist" all of the data I wanted.
- guenthert 4y agoEr, you'd store the data in your DB of course and only a comparatively small, encrypted index to it in the URL. You wouldn't trust the client to "persist" the data anyhow.
- diroussel 4y agoThe question was about storing state in the URL. You are referring to storing a session I’d in the URL. Quite different.
- majormajor 4y agoI think the poster is referring to things like "offline Google Docs editing that can survive a browser shutdown or crash" which would be... difficult... to cram into a URL ;)
- yen223 4y agoI really hope y'all are aware that URLs generally aren't treated as secret, but authenticated session state should be treated as secret.
- Retric 4y agoUsing a username and password, or saving a bookmark to the current page both work.