Session does not exist

When running the installable cloud application, the following error occurs: Session does not exist.

Cause 1

After a session starts, if the user has not sent any requests to the server during the session timeout period, the session will time out, and the "Session does not exist" error will display.

If the "Session does not exist" error occurs frequently, you should consider changing the session timeout value to an appropriate number or create a heartbeat feature in the application.

Solution 1

#1: View and/or configure the session timeout value in the PowerServer Web APIs > AppConfig > Applications.json > "Applications". By default, the timeout period for a session is 3600 seconds. For more about the session timeout value, refer to Configure the timeout settings.

Note that if you store the configurations in the database instead of the file, go to the PowerServer_ApplicationConfig table instead of the Applications.json file.

#2: Create a heartbeat/keepalive feature that keeps the connection active with a timer for as long as the application is open.

Cause 2

The default recycle settings for the IIS application pools may cause the session to become invalid.

Solution 2

Step 1: In IIS Manager, select Application Pools in the Connections pane, and then click Set Application Pool Defaults... in the Actions pane.

Step 2: Change the value of both the Idle Time-out (minutes) and the Regular Time Interval (minutes) options to 0.


Cause 3

If you have configured the load-balancing functionality, but not the sticky cookie, the "Session does not exist" error occurs.

Sticky cookie is required to support session persistence in the load-balancing environment.

Solution 3

1. Configure the load-balancer or gateway to support the sticky cookie. You can check the documents from the corresponding vendor for how to do that.

2. Use a Web debugging tool such as Fiddler to capture the user requests and determine whether the cookie is written successfully. If not successful, you can check the corresponding document to troubleshoot the issue, such as https://learn.microsoft.com/en-us/azure/application-gateway/how-to-troubleshoot-application-gateway-session-affinity-issues.