AnonymousIdentificationModule Class
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.
Manages anonymous identifiers for the ASP.NET application.
public ref class AnonymousIdentificationModule sealed : System::Web::IHttpModule
public sealed class AnonymousIdentificationModule : System.Web.IHttpModule
type AnonymousIdentificationModule = class
interface IHttpModule
Public NotInheritable Class AnonymousIdentificationModule
Implements IHttpModule
- Inheritance
-
AnonymousIdentificationModule
- Implements
The following code example shows a Web.config file for an application that enables anonymous identification.
<configuration>
<system.web>
<authentication mode="Forms" >
<forms loginUrl="login.aspx" name=".ASPXFORMSAUTH" />
</authentication>
<anonymousIdentification enabled="true" />
<profile defaultProvider="AspNetSqlProvider">
<properties>
<add name="ZipCode" allowAnonymous="true" />
<add name="CityAndState" allowAnonymous="true" />
<add name="StockSymbols" type="System.Collections.ArrayList"
allowAnonymous="true" />
</properties>
</profile>
</system.web>
</configuration>
The AnonymousIdentificationModule class creates and manages anonymous identifiers for an ASP.NET application. Anonymous identifiers are used by features that support anonymous identification such as the ASP.NET System.Web.Profile.
The AnonymousIdentificationModule exposes a Creating event that enables you to set the anonymous identifier to a custom value. If you do not specify a custom anonymous identifier value, a Guid is used.
The Creating event is accessed by specifying a subroutine named AnonymousIdentification_Creating in the Global.asax file for your ASP.NET application.
The AnonymousIdentificationModule is only used when anonymous identification is Enabled by setting the enabled attribute of the anonymousIdentification configuration element to true
.
Note
Anonymous identification is independent of any type of ASP.NET authentication.
Anonymous |
Creates an instance of the AnonymousIdentificationModule class. |
Enabled |
Gets a value indicating whether anonymous identification is enabled for the ASP.NET application. |
Clear |
Clears the anonymous cookie or identifier associated with a session. |
Dispose() |
Releases all resources, other than memory, used by the AnonymousIdentificationModule. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Init(Http |
Initializes the AnonymousIdentificationModule object. |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
To |
Returns a string that represents the current object. (Inherited from Object) |
Creating |
Occurs when a new anonymous identifier is created. |
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: