You can create a custom login page (i.e. using an object to capture the user's login information). You now have the user's username, so you can persist all your shopping cart information, associated with the correct user. You then create a session for the user, redirect the user to a request handler to set his cookie and finally, when the user accesses your application with his new session, you retrieve the persisted objects.
If desired, I can share the code for the login, session creation and request handler in Mendix 7.
Herbert,
Is this on github? I’ve made some fixes for mx8.
OverwriteDefaultLoginAction.java line 33: replace core.addlistener with
Core.getListenersRegistry().addListener(loginActionListener);
TransferDataLoginAction.java
line 66
anoUser = User.load(sysContext, oldSession.getUser(getContext()).getMendixObject().getId());
line 71
User signInUser = User.load(sysContext, newSession.getUser(getContext()).getMendixObject().getId());
We have fixed the module for Mendix 8. https://appstore.home.mendix.com/link/app/66443/
thanks for the feedback everyone!
There is one trick, for Mx6, I have not yet tested it with Mx7:
In the navigation microflow, create a non-persistent object and link it to the session.
When the anonymous user logs in, the navigation microflow is called again, this time with the logged in user. However, the session is still the same one. At least that is the case in Mx6. Now you can retrieve your NPE from the session and continue with that object.