CreatingCookieEventArgs::CookieIsSet Property

 

Gets or sets a value that indicates whether the authentication cookie has been created.

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

public:
property bool CookieIsSet {
	bool get();
	void set(bool value);
}

Property Value

Type: System::Boolean

true if the authentication cookie was created; otherwise, false.

The AuthenticationService class checks the CookieIsSet property to determine whether the authentication cookie has been created. You set this value to true if you create an authentication cookie in an event handler for the CreatingCookie event. If CookieIsSet is set to false (the default value), the AuthenticationService class creates an authentication cookie, This overwrites any cookie that you have created in the handler for the CreatingCookie event.

The following example shows an event handler for the CreatingCookie event. The handler retrieves user values from the CreatingCookieEventArgs object to customize the authentication cookie. The CookieIsSet property is set to true after the authentication ticket is created.

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

.NET Framework
Available since 3.5
Return to top
Show: