Original

You are currently reviewing an older revision of this page.
Go to current version

Requirement: Programatically increase security validation timeout for a web application in SharePoint

Solution: The following line of code will set the Web Page Security Validation expiry to 60 minutes

SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://webappURL/"));
 
//Use TimeSpan constructor to specify Days, hours, minutes, seconds
webApp.FormDigestSettings.Timeout = new TimeSpan(1, 0, 0);
 
//Save the changes
webApp.Update();