M
M
magary42016-10-07 22:32:34
symfony
magary4, 2016-10-07 22:32:34

How to split sessions by time?

there is a wishlist on the site which is stored in the session
session responsible for the user's login in time 24 hours
is there a way to store the basket for example a month?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
Nwton, 2016-10-07
@magary4

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.

A
Alexey Ukolov, 2016-10-07
@alexey-m-ukolov

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.

A
Artem Soshnikov, 2016-10-07
@artem90

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.

X
xmoonlight, 2016-10-08
@xmoonlight

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 question

Ask a Question

731 491 924 answers to any question