My application has a shopping cart in which anonymous users can fill their cart with products. User login is only required before payment. How can this be implemented?
The main problem is that the flask should track the user (even anonymous) and their orders. My current approach is to use the AnonymousUserMixin object, which is assigned to current_user . It is assumed that current_user will not change throughout the session. However, I noticed that a new AnonymousUserMixin object is assigned to current_user , for example, each time the browser page is refreshed. Please note that this does not happen if the user is authenticated.
Any suggestions on how to get around this?
source share