State is invalid / session timeout unexpectedly

  • 2 March 2022
  • 3 replies
  • 218 views

Userlevel 7
Badge +21

I have encountered a situation when logging in as a user into the Employee Portal but after a few minutes, my session was no longer valid or state invalid.

In this case, it turned out there were multiple environments connecting to the same database profile.  This causes an issue as each environment maintains its own timers for managing the connection and they are usually conflicting with each other.

To determine if there are multiple environments connecting to the same database profile, run the following query:

SELECT last_updated, 
       server_name, 
       server_alias
FROM ap_appservers;

If you see multiple rows, look at the server names and see if they are from the same environment.  In the case shown below, the two servers were not from the same environment and the user was constantly being thrown out.

This really becomes an issue when the two environments are in completely different time zones so the session timers evaluating the last access datetime may appear longer than the allowed session duration. 

In the case of a multi-server environment, you will see more than a single row (one for each application server).


3 replies

Userlevel 7
Badge +10

What we usually do in our development environments is increase the Session timer value on the profile in the Configuration Editor so that it doesn’t expire the sessions running on the other servers.

Userlevel 7
Badge +21

Good idea, Anthony, if the environments are relatively close in their time zone configuration.

In the scenario I ran into today… it was several hours difference between the two environments.

Userlevel 4
Badge +5

And we usually put the max value of 86400 in Session Timer just to be on the safe side that the session will not expire unexpectedly. 

 

Reply