This documentation is archived and is not being maintained.

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

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: