RoleManagerSection.CookieSlidingExpiration Property

 

Gets or sets a value indicating whether the cookie that is used to cache role names will be reset periodically.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

<ConfigurationPropertyAttribute("cookieSlidingExpiration", DefaultValue := True)>
Public Property CookieSlidingExpiration As Boolean

Property Value

Type: System.Boolean

true if the role names cookie expiration date and time will be reset periodically; otherwise, false. The default is true.

You can specify whether the cookie that is used to cache role names is periodically reset or expired at a fixed point in time by using the cookieSlidingExpiration attribute in the Web.config file for your ASP.NET application. If true, the cookie expiration is initially set to the current date and time plus the CookieTimeout property, in minutes. While the user continues to actively use the ASP.NET application, the expiration date and time of the cookie is automatically refreshed, if there is less than half of the CookieTimeout remaining. The default is true.

The following code example demonstrates how to use the CookieSlidingExpiration property. This code example is part of a larger example provided for the RoleManagerSection class.

' Display CookieSlidingExpiration property.
Console.WriteLine("CookieSlidingExpiration: {0}", _
 configSection.CookieSlidingExpiration)

.NET Framework
Available since 2.0
Return to top
Show: