Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is a terrible use case for cookies. Any browser reset or change, new computer, your phone, etc, and you need to redo the whole experience every time. I'd rather login and customize once.

Cookies get sent with most requests as headers so you're unnecessarily bogging down requests with data unrelated to the session.



It can be worked around. For example, you can use those cookies just to initialize the client web browser. Once it's done, the data can be cached inside the localStorage, and the cookie itself can be deleted (Or changed to a marker that tells the server that the client has been customized).

Of course this may require some heavy changes on the client-side code, as the client now must have the ability to apply user's customization locally, but there are benefit: After you done that, then you don't have to read user's customization data from any of your infrastructure every time user reloads your page.


I don't think a gzipped header with some hundreds of bytes of JSON (or BSON) for preferences is that much bigger than one with a session id string in a cookie.


100% exactly. Cookies are device and moment specific. Whereas a user account can easily save and transport the saved experience/setting anywhere the user wants to access them.


I specifically do not want to have the same experience on multiple devices.

I do not want to have the same experience on my work computer vs my home computer.

I do not want to have the same experience on my home computer vs my personal phone.

I do not want to have the same experience on my personal phone vs my work phone.

I do not want to have the same experience on my work phone vs my work computer.


Firefox (and Chrom{e,ium} AFAIK) can sync up your cookies, among other things.


but if you go this route, you have to share them with a third party (Mozilla or Google)?


Yes, but Firefox's Sync is open source [1], so you should be able to set up a private instance. IDK how easy or hard it is though.

[1] https://wiki.mozilla.org/CloudServices/Sync


Thanks for the suggestion. That wiki page brought me to https://mozilla-services.readthedocs.io/en/latest/howtos/run... which I intend to try out. I want to migrate my a Firefox profile from Windows to Linux and synching seems to be the easiest way to transfer bookmarks and saved passwords.


I am struggling to understand how it is bogging down requests with data that are "unrelated" to the session.

Cookies are delivered with the request. If it has feature selections, great, no more work necessary on your part.

If the feature selection is hidden behind a user ID, then you need to look up the user ID in a database and then request the user's features.

Indeed, it seems to me that requiring a login in order to customize the viewing experience is what bogs down requests.


You could backup your cookies and share them across devices? ... I don't think "bogging down" requests is a very big issue nowadays...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: