i was writing small ecommerce application in django framework. so i was trying to implement add to cart functionality like that if user is anonymous user then selected products should be mapped to it's session id which is act. cart id in models. so the scenario is that whenever anonymous user check out and mapped data against that session id is purged. Is there any mechanism to save anonymous user session data even after user logs in. kindly provide easy possible solution as i am bit new to django:)
Thanks,
Siddharth
On dinsdag 12 juni 2018 12:01:32 CEST Siddharth Srivastava wrote:
> so the scenario is that whenever anonymous
> user check out and mapped data against that session id is purged. Is there
> any mechanism to save anonymous user session data even after user logs in.
> kindly provide easy possible solution as i am bit new to django:)
Well, the easy solution is to follow the documentation:
Note that any data set during the anonymous session is retained in the
session after a user logs in.
--
Melvyn Sopacua
The only way I can think of is when your user goes to log in - check if their session id is already recorded.
When they login - I assume that they get an new Session Id - and remap the data from their old session id to their new session Id.
Would that work ?
On 12/06/18 11:01, Siddharth Srivastava wrote:
Hi ,
i was writing small ecommerce application in django framework. so i was trying to implement add to cart functionality like that if user is anonymous user then selected products should be mapped to it's session id which is act. cart id in models. so the scenario is that whenever anonymous user check out and mapped data against that session id is purged. Is there any mechanism to save anonymous user session data even after user logs in. kindly provide easy possible solution as i am bit new to django:)
Thanks,
Siddharth
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com <mailto:django-users+unsubscrib...@googlegroups.com>.
To post to this group, send email to django...@googlegroups.com <mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d17bbc16-4c0b-4d06-bfa5-af814a20cbc6%40googlegroups.com <https://groups.google.com/d/msgid/django-users/d17bbc16-4c0b-4d06-bfa5-af814a20cbc6%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.