PersistentSessionLifetime Property
Collapse the table of content
Expand the table of content

CookieHandler.PersistentSessionLifetime Property

.NET Framework (current version)
 

The lifetime of persistent sessions. If zero, transient sessions are always used.

Namespace:   System.IdentityModel.Services
Assembly:  System.IdentityModel.Services (in System.IdentityModel.Services.dll)

public virtual Nullable<TimeSpan> PersistentSessionLifetime { get; set; }

Property Value

Type: System.Nullable<TimeSpan>

The session lifetime. The default is null.

Exception Condition
ArgumentOutOfRangeException

A value that is less than zero is specified.

Tickets for persistent sessions are stored in file-based cookies, meaning that the sign-in session may continue after the web browser is closed and reopened.

This property is used to set the HttpCookie.Expires property.

The property can be initialized by specifying the persistentSessionLifetime attribute on the <cookieHandler> element in configuration.

.NET Framework
Available since 4.5
Return to top
Show:
© 2016 Microsoft