CreatingCookieEventArgs::IsPersistent Property
.NET Framework (current version)
Gets a value that indicates whether the authentication cookie should be retained beyond the current session.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
Property Value
Type: System::Booleantrue if the cookie should be retained beyond the current session; otherwise, false.
When you create a FormsAuthenticationTicket object, you can use the IsPersistent property to specify whether the authentication cookie is retained beyond the current session.
The following example shows an event handler for the CreatingCookie event. The handler retrieves user values from the CreatingCookieEventArgs object in order to customize the authentication cookie. The IsPersistent property of the FormsAuthenticationTicket object is set to the value in the IsPersistent property.
.NET Framework
Available since 3.5
Available since 3.5
Show: