AnonymousIdentificationSection.Cookieless Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating whether to use cookies.
public:
property System::Web::HttpCookieMode Cookieless { System::Web::HttpCookieMode get(); void set(System::Web::HttpCookieMode value); };
[System.Configuration.ConfigurationProperty("cookieless", DefaultValue=System.Web.HttpCookieMode.UseCookies)]
public System.Web.HttpCookieMode Cookieless { get; set; }
[<System.Configuration.ConfigurationProperty("cookieless", DefaultValue=System.Web.HttpCookieMode.UseCookies)>]
member this.Cookieless : System.Web.HttpCookieMode with get, set
Public Property Cookieless As HttpCookieMode
One of the HttpCookieMode values. The default value is UseDeviceProfile.
- Attributes
The following code example demonstrates how to access the Cookieless property.
// Get Cookieless.
System.Web.HttpCookieMode cookieless =
anonymousIdentificationSection.Cookieless;
Console.WriteLine("Cookieless: {0}",
cookieless);
' Get Cookieless.
Dim cookieless _
As System.Web.HttpCookieMode = _
anonymousIdentificationSection.Cookieless
Console.WriteLine("Cookieless: {0}", cookieless)
The Cookieless property defines when a cookie should be used to maintain information about the user.
When the Cookieless property is set to UseCookies, the user's identifier is stored in a cookie. For more information, refer to HttpCookieMode.
Note
ASP.NET stores the user's anonymous identifier within the URI path (that is, it runs in cookieless mode) if the Cookieless property is set to one of the following values: UseUri; UseDeviceProfile when the browser profile indicates that cookies are not supported; or AutoDetect when the auto-detection process determines that the browser does not support cookies. Finally, if the size of the URI and the anonymous identifier exceeds the allowed length, the anonymous identifier is not applied.
Product | Versions |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: