Sessions
PowerShell Univeral maintains sessions for users within each app. There are several locations you can configure user session information.
App Session Setting
Session settings for an app are using the web server session setting by default. You can set the app session timeout for an individual appby using the -SessionTimeout of New-PSUApp. The timeout value is in minutes.
New-PSUApp -Name 'dashboard' -BaseUrl / -SessionTimeout 30App sessions are sliding and will not expire while the window is open and active. Some browsers will pause tabs which will cause the session to expire after the time out.
Restarting an app will cause all sessions to disconnect.
Web Server Session Setting
The web server will maintain a session for the user. The session is sliding and will not expire while the window is open and active. Some browsers will pause tabs which will cause the session to expire after the time out.
The default value for the web server session timeout is 25 minutes. You can change the web server session setting by updating the appsettings.json file.
"SessionTimeout": 25App Idle Timeout
In addition to app session timeout, you can also timeout the app when it is idle. Even if the window is open, if the user does not click, type or move the mouse for the idle timeout period, the window will time out. This functionality is disabled by default.
You can set the idle timeout in minutes by setting the -IdleTimeout parameter of New-PSUApp cmdlet.
New-PSUApp -Name 'dashboard' -BaseUrl / -IdleTimeout 30IIS Timeouts
IIS can cause timeouts of sessions in numerous ways. You will need to configure your application pool's recycling settings, otherwise IIS may recycle the pool and remove all app sessions.
Open the application pool's Advanced Settings dialog and, under Recycling, set the following:
Private Memory Limit (KB), Request Limit, and Virtual Memory Limit (KB) — set to
0to disable memory- and request-based recycling triggers.Regular Time Interval (minutes) — leave at its default value of
1740(29 hours) rather than shortening it.Disable Overlapped Recycle and Disable Recycling for Configuration Changes — leave at their default of
False.
This prevents IIS from recycling the application pool on a schedule or resource threshold that would otherwise disconnect active sessions.
Last updated
Was this helpful?