Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
What is there to think? Write the basket to the database. Maybe a person wants to log in from a tablet, and you have a basket in localstorage and he will be unpleasantly surprised.
Every month, run an auto check of baskets and if the date of the basket update is more than a month, clear it. Or immediately put expires, if bd allows.
is there a way to keep the basket for example a month?In session, no. But you can write a basket to a database, a file, or, at worst, to LocalStorage.
For example, store cart data not in the session, but in the radish. The user needs to set a cookie for a month, and in the radish expires for a month.
Put the basket in the database to the user and keep as long as you want. It's a USER!!!!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question