Hi Kamalanathan,
Hope the below code will work for your scenario,
IMxRuntimeResponse response= this.getContext().getRuntimeResponse().get();
IContext systemContext = Core.createSystemContext();
ISession newSession = Core.initializeSession(Core.getUser(systemContext, user.getName()), "");
response.addCookie("XASSESSIONID", newSession.getId().toString(),"/" ,"" ,-1 );
response.addCookie("XASID", "0." + Core.getXASId(),"/" ,"" ,-1);
Thanks!
I do not believe you can change a user session from anonymous to a real user. Instead, you need to replace the session. Doing this requires a few steps:
This module does that – you might use it for inspiration:https://appstore.home.mendix.com/link/app/107925/