Some cases, our clients (SharePoint Client) may request to change the session time out of SharePoint sites. It is allowed to set timeout of the user session in SharePoint so that users are logged out after certain time of inactivity. Additionally, current page state will be expired based configure timeout. There are multiple ways, we can configure session timeout.

From central Administrator:

Go to SharePoint  Central Admin
Go to Application Management
Select Configure Session State
Under Timeout, change the default value stored there.

Power Shell ( SharePoint Management Shell)

This is handy for forms which have to be filled within certain period of time before they expire. Alternatively, if you want to extend the timeout – you can do that.

$spsite = Get-SPSite("[site collection url]")
$webApp = $spsite.WebApplication
$webApp.Enabled = $true
$webApp.Expires = $true
$webApp.Timeout = New-TimeSpan -Hours 2 -Minutes 30
$webApp.Update()

This will enable session expiration and set page content to timeout after 2 hours and 30 minutes.

If you’re using claims authentication and would like for your provider to expire sessions after certain period of inactivity, here is how to do that with Power Shell:

$tokenservice = Get-SPSecurityTokenServiceConfig
$tokenservice.UseSessionCookies = $true
$tokenservice.LogonTokenCacheExpirationWindow = New-TimeSpan -Minutes 5
$tokenservice.Update()

Logon expiry will be set to 5 mins.

By Rijwan Ansari

MVP, CSM, CSPO, MCP, MCTS. Sr. Software Developer. Expertise in ASP.NET MVC, Angular, AngularJs, .Net Core, C#.NET, Azure, Cognitive Services, Machine Learning, SharePoint, Azure Services, and tools, Requirement Analysis, Team Management, Pre-Sales and more. Ability to work independently and Team, handle pressure and meet commitment. Excellence Communication and adjust in any environment

Leave a Reply

Your email address will not be published. Required fields are marked *