Preserving sessions through REST

Hi forum, I have a Mendix app that has an exposed REST service ‘Content’. The Content service should memorize sessions through subsequent requests. I want to store some session-related data that I want to retrieve in later requests. Currently, I have an authorization microflow with username and password that initializes an authorized session through a Java action: IUser user = Core.getUser(getContext(), this.Username); ISession session = Core.initializeSession(user, this.GuestSession.getSessionId()); return session.getMendixObject(); It returns the session ID that I can later use to retrieve the session and check if the user is authorized. This works fine, except that that session is not actually used during the Content service. The $currentSession is a completely new session for every request. I could retrieve the session that I store data in from the database, but ideally I would have the $currentSession as the previously created authorized session. This way, I preserve keepAlives and all the other things that Mendix does for session management, instead of having to create my own session management. How can I reuse sessions through different REST calls?
0 answers