Associate Non persistant entity with System.User to use that Globally in the app

Hi, I have a requirement, that In our Mendix application we are using custom login page and calling external app API to login to that application and getting session details from there and landing to Mendix Dashboard page. Now I want to use that session information for further api calls in our mendix application. For that I need that session information should be available in entire app. but I dont persist that. So I thought we can associate that session with System.User entity. But when I navigate to some other pages , Non persistant entity getting empty. how can we use a non persistan entity globally.
2 answers

Hello Vijayakumar,


Store your session information in the browser cookies or local storage.


The non-persistent entity's lifetime is limited to the Microflow it is in. The moment the Microflow ends, the object is not present. If you need to access the data in another function, you should copy it to a persistent entity (use community commons ORM functions CopyAttributes) and set the association to the system.user entity. Don’t forget to clean up the persistent objects.