Below are the Powershell commands that enables you to close the session of a login user after a defined time frame, if the user is idle or not doing any activity on the SharePoint Site.
- $sts = Get-SPSecurityTokenServiceConfig
- $sts.UseSessionCookies = $true
- $sts.FormsTokenLifetime = (New-Timespan –Minutes 5)
- $sts.LogonTokenCacheExpirationWindow = (New-Timespan –Minutes 5)
- $sts.Update()
- iisreset