You can use this module from the appstore: https://appstore.home.mendix.com/link/app/66443/
You can use the method that Matt Daniels wrote in his Autologin blog. I believe there is a module in the appstore but I haven’t used it before.
What you could do is associate all your data for anonymous users to the session table. So in the case of a website where you have a shopping cart, you can associate that shopping cart to that anonymous users session. Then when a user decides to create an account, you can create a custom form to capture username/password and then use the autologin feature to log the user in. The request handler that takes care of logging in uses the runtime api to create a new session. This has the option to pass the Id of the old session (which would be the anonymous session), in order to transfer any information over.
public static ISession initializeSession(IUser user, java.lang.String currentSessionId) throws CoreException Initialize a new session for the given user. Parameters: user - the user for which the session should be initialized. currentSessionId - id of the current session, will be used to transfer data when current session is associated with a guest user. Returns: the created session. Throws: CoreException
So when a user logs in from anonymous to their new account, the shopping cart that was associated to the session would be associated to their new session.
I haven’t tested this but that’s my understanding of how this works.
Hope this helps!
OK thank you I made it work with the SignIn microflow Module, this module does not work with the login button, but works well with the loginform module