Logout and Session Vars (when you can't get rid of your previous session values)

Logout and Session Vars (when you can't get rid of your previous session values)

Hello everyone,

One very common issue I'm faced with when developing outsystems applications with authentication (in particular, integrated with EnterpriseManager) is the fact that, after logging out and logging in again in the same browser page, the session state remains the same (i.e. I continue seeing the previous logged-in user session values on screen).

This behavior is expected and is the result of two facts:
1. By Logging in the same browser window, the user will be using the same ASP.Net session the previous user was. This is due to the fact that the session identifier is saved in a cookie (named ASP.NET_SessionId) or in the URL of the page. If the Login operation was made persistent the problem is even bigger, as the session cookie will not be disposed even when the user closes the browser window!)
2. The outsystems built-in Logout action does not clear the Session Variables.

To avoid the sharing of session variable values between user logins, I developed a trivial extension that executes a .Net Session.Clear() operation. This operation will clear all the session values and the OnSessionStart action will be triggered again when the next user logs in. I call this action when the user does a logout in the Enterprise.oml eSpace. The extension goes attached so that you can use it if it suits your needs.

I would also like to know if someone else has dealt with/solved this problem in some other way.

Best Regards,

Daniel Lourenço

hi daniel,

Does the sessionCleaner also clear out session variables that are created in service studio, for example, the ones used as search paramters?
I am trying to do this without any succes so far..

If i log out and log in again as another user, the session variables are not cleared out.. 

I put the session cleaner first in the logout action of the enterprise.oml and also in the logout action of my app, but no luck..
maybe the sessionCleaner is not designed to do what i want? Do you have any suggestions?

Platform Server version:
Enterprise Manager version: 5.0.9

Martha van de Berg

Hi Martha.

I have the same problem that you.
Did you solve the problem? If yes, please tell me.

Thanks in advance.