CreatingCookieEventArgs::IsPersistent Property

 

Gets a value that indicates whether the authentication cookie should be retained beyond the current session.

Namespace:   System.Web.ApplicationServices
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

public:
property bool IsPersistent {
	bool get();
}

Property Value

Type: System::Boolean

true 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.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.5
Return to top
Show: