AnonymousIdentificationModule AnonymousIdentificationModule AnonymousIdentificationModule AnonymousIdentificationModule Class


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


The following code example shows a Web.config file for an application that enables anonymous identification.

    <authentication mode="Forms" >  
      <forms loginUrl="login.aspx" name=".ASPXFORMSAUTH" />  

    <anonymousIdentification enabled="true" />  

    <profile defaultProvider="AspNetSqlProvider">  
        <add name="ZipCode" allowAnonymous="true" />  
        <add name="CityAndState" allowAnonymous="true" />  
        <add name="StockSymbols" type="System.Collections.ArrayList"   
          allowAnonymous="true" />  


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.


Anonymous identification is independent of any type of ASP.NET authentication.


AnonymousIdentificationModule() AnonymousIdentificationModule() AnonymousIdentificationModule() AnonymousIdentificationModule()

Creates an instance of the AnonymousIdentificationModule class.


Enabled Enabled Enabled Enabled

Gets a value indicating whether anonymous identification is enabled for the ASP.NET application.


ClearAnonymousIdentifier() ClearAnonymousIdentifier() ClearAnonymousIdentifier() ClearAnonymousIdentifier()

Clears the anonymous cookie or identifier associated with a session.

Dispose() Dispose() Dispose() Dispose()

Releases all resources, other than memory, used by the AnonymousIdentificationModule.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
Init(HttpApplication) Init(HttpApplication) Init(HttpApplication) Init(HttpApplication)

Initializes the AnonymousIdentificationModule object.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)


Creating Creating Creating Creating

Occurs when a new anonymous identifier is created.

Applies to