I made a shopping cart with following tutorial and all works fantastic!
But I need the data store to expire after maybe an hour? I am running into a situation where customers can add tickets to their cart and leave their browser open and still be able to order tickets after sales have been closed. I’d like my cart to time out after about an hour. Is that possible?
The session storage stores data for a session, meaning that the data is stored until the browser (or tab) is closed.
As i suggested some time back, you need to check this on the server side when purchasing and not rely only on browser storage, as it can easily be manipulated or as in your case get outdated info
Otherwise, you can try some solution like an action scheduler, which clears the cart content after a certain amount of time …