D
D
Denwebart2016-05-13 21:21:23
Online shopping
Denwebart, 2016-05-13 21:21:23

Wish list without registering on the site?

There is a task to implement a wish list in an online store without user registration.
Online store on Laravel 5.2. Can you please tell me where is the best place to store products added to the wish list?
In sessions or cookies? How right?
And how to make sure that they are stored there for as long as possible?
I understand that you can simply increase the session storage time in the Laravel settings.
But still, I wonder how professionals do it? I'm doing an online store for the first time.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
landergate, 2016-05-13
@Denwebart

You can assign your session-cookie to the person who clicked on "add wishlist". She will authorize him in the future.
Caution: the user can change the cookie on his side. Make a long random hash in the cookie to reduce matches with other users.
It is possible to store the selected products in the database - display wish-products by matching with its session-cookie - but this is undesirable: any massive flood on the "add to wishlist" button with disabled cookies will flood your database with a ton of non-existent records.
Therefore, instead of authorization, you can simply store the selected products in cookies without creating any sessions.
Должно быть понимание, что пользователь не увидит свой wishlist между устройствами, а в дальнейшем потеряет его при обнулении кук или переключении на другой браузер.

Котик Антон, 2016-05-14
@27cm

https://github.com/samyk/evercookie/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question