Showing posts with label powershell. Show all posts
Showing posts with label powershell. Show all posts

Friday, December 19, 2014

Setting Timespan for forms authenticated user in SharePoint

If you want to make user logout after one min of idle status try the below code, this is only for forms authenticated users.
Run the below script in powershell script

$Data = Get-SPSecurityTokenServiceConfig
$Data .UseSessionCookies = $true
$Data .FormsTokenLifetime = (New-Timespan –Minutes 2)
$Data .LogonTokenCacheExpirationWindow = (New-Timespan –Minutes 1)
$Data .Update() 

Enabling session in SharePoint


Error:System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration.

When you see the above error try the below resolution
Enable-SPSessionStateService -DefaultProvision

I have tried many solutions that are out there on other site but nothing seems to resolve my issue
finally used powershell command and site came up like magic.

SharePoint - Cannot convert a primitive value to the expected type 'Edm.Double'. See the inner exception for more details If y...

Ad