Hi Guys,

I need a help, I work in a big project on outsystems, we have a lot of merge problems, this bring to us a lack of productivity, so we decide to broken the interface in more than one module, today we have 5 UL module and this works amazing in traditional.


But we have a problem, the Session dont share between this layers, and this is a big problem.
I theory, my app is a single sign-on, and I think that need to share the session, but how I configure to UL session to works that way?

How I share session between this interfaces modules in traditional?


Hi Boschini,

I'm assuming that you mean that the user has to login for each module?

Or are you referring to the fact that you can't access the session variables from one module to another?

To share the session over multiple modules, and thus avoid multiple logins, you have make sure they are using the same user provider. And of course the user must have the right roles assigned to access the different modules.

To access the session variables from one module, you need to create actions/functions to get these values.

Regards,
Lennart

Lennart Kraak wrote:

Hi Boschini,

I'm assuming that you mean that the user has to login for each module?

Or are you referring to the fact that you can't access the session variables from one module to another?

To share the session over multiple modules, and thus avoid multiple logins, you have make sure they are using the same user provider. And of course the user must have the right roles assigned to access the different modules.

To access the session variables from one module, you need to create actions/functions to get these values.

Regards,
Lennart

 Hi Lennart,


My app have one login for all modules(UL), I use single sign-on and this works as well.
The problem is,my principal user layer has the sessions, for example we have a SelectedStoreId session, but when I access other UL, this session dont be assessable.

This is a huge problem, because if this is not possible I need to change all my architeture to use one user layer instead a multiples.


 

Hi,

In this case you could store the SelectedStoreId in a session of a module in the Core layer and create actions/functions to set and get the SelectedStoreId from the session. If you use the get-action as a function, then you can even use it in a aggregate as if you could access the session variable directly, by putting e.g. Session_SelectedStoreId_Get() instead of Session.SelectedStoreId.

Regards,
Lennart

Hello Boschini,

Session variables are dependent on the module where they are defined. This means that you cannot access directly to a session variable defined in one module from another module. Their scope applies only to the module where they are.

However, you can expose them and overwrite their values using actions for that purpose. These actions should be defined as Public in order to be used in another modules. This way will allow you to get and set the values from your session variables.

Since they are going to be used by several End-User modules, you should follow Lennart's suggestion and create a Common module to manage all of these session variables. This module should be in the Core Services Layer. Let's call it SessionManagement_CS as an example. Then you just need to create those actions inside this module and use them in your UL modules.


Here's an example just to make it clear for you. The get action should be something like:

 

Like I said, just define this action as Public and you will be able to use the value of Session.SelectedStoreId across your modules. The same applies to the set action and it should be very similar, something like:



Hope that this helps you!


Kind regards,

Rui Barradas