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

You don't need cookies for a persistent shopping basket. If I want a persistent shopping basket, give me the option to create an account and store my shopping basket for later use. Otherwise, just nuke my shopping basket when my session cookie expires. This is a non-issue.

Of course it's not visitors who want persistent shopping baskets. It's sellers. And I don't really care about what they want. On ~100% of the websites I visit, I'm the visitor, not the seller. And given that webshops were a thing before persistent shopping baskets were a thing, I'll wager they can do without.



Logging into an account requires some kind of persistent identifier. And it is not just for shopping carts - you also have a login and cookie here on Hacker News.


Cookies were introduced as a hack to allow sessions. When HTTP/2 was being proposed phk raised this issue and asked why they didn't use this as an opportunity to make real fixes to http warts like this and eliminate cookies[1]. But given that it was pushed by Google, which didn't mind them, this of course was ignored.

[1] https://varnish-cache.org/docs/trunk/phk/http20.html


And such a cookie one that is necessary for the site to function, and as such not covered by cookie laws.


Yes, but elric is arguing that even those kind of cookies are unnecessary. Meaning I would have to log in every time I visited Hacker News.


I think they said it was unnecessary until you logged in, which was the thing that the Hacker News cookies were being used for?


Yeah agreed. I was just replying to elric who argued we shouldn't need cookies at all.


> Of course it's not visitors who want persistent shopping baskets. It's sellers.

That’s not so simple. Persistent shopping baskets create problems for sellers e.g. stock changes; price changes; products may become obsolete. Some of them let the cart expire at some point, even down to a couple hours for some (ASOS). As a visitor I do want a persistent cart accross sessions because I may need some time to make (nor not) my purchase. And no, I won’t give you my email just for that.


I run a game where you can play without creating an account, and going back to the game later will take you back to your previous state. How would I manage this without cookies? A lot of people don't want to create an account.


Can you ask them if they'd like to save their progress?


Save it where? What if there's no budget for server infrastructre? Say... a hobby project.


A query argument inside a URL that they can bookmark is one option.


Local storage?


I assume that whatever fate befalls cookies will happen to localStorage as well. But maybe not. localStorage is kind of better for this purpose in any case.


Shouldn't you be using localStorage for that?


The state is saved on a server. I only need an identifier to retrieve the state but sure, I could use localStorage instead for saving the identifier. What's the difference though?


For some reason I assumed that you've saved game state in cookies.




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

Search: