User specific variable - session bean

Hi
Can you share an idea how the specific entity value can be preserved for each user during the session? For example, an User logs in, selects one of Many companies data he wants to enter transaction for. Therefore, the company entity selected by the user will remain available to use irrespective of the screen of business log the user using. A Stateless session bean can be a solution but not sure. Thanks for any help.

Hi Mortoza,

what about the UserSession class? It has a method called getAttribute

Although it seems primarily be used in a security context, you can store anything in there. Here’s the documentation about it: https://doc.cuba-platform.com/manual-6.1/userSession.html
To get the current session, you can inject the Interface UserSessionSource.

Bye,
Mario