Export (0) Print
Expand All
Expand Minimize

AnonymousIdentificationSection Class [IIS 7 and higher]

IIS 7.0

Specifies how cookies are used in a Web application.

class AnonymousIdentificationSection : ConfigurationSection

The following table lists the methods exposed by the AnonymousIdentificationSection class.

Name

Description

GetAllowDefinition

(Inherited from ConfigurationSection.)

GetAllowLocation

(Inherited from ConfigurationSection.)

RevertToParent

(Inherited from ConfigurationSection.)

SetAllowDefinition

(Inherited from ConfigurationSection.)

SetAllowLocation

(Inherited from ConfigurationSection.)

The following table lists the properties exposed by the AnonymousIdentificationSection class.

Name

Description

Cookieless

A read/write sint32 enumeration that specifies whether to use cookies for a Web application. The possible values are listed later in the Remarks section.

CookieName

A read/write string value that specifies the name that is assigned to the cookie. The default is ".ASPXANONYMOUS".

CookiePath

A read/write string value that specifies the path to the directory where the cookie is stored. The default is the root directory, specified by "/".

CookieProtection

A read/write sint32 enumeration that specifies the cookie protection scheme. The possible values are listed later in the Remarks section.

CookieRequireSSL

A read/write boolean value. true if the cookie requires a Secure Sockets Layer (SSL) connection when it is transmitted to the client; otherwise, false. The default is false.

When the ASP.NET Secure authentication cookie property is set, the cookie is returned by the client only if an SSL connection is in use.

CookieSlidingExpiration

A required read/write boolean value. true if the cookie expiration is initially set to the current date and time plus the value in minutes in the CookieTimeout property; otherwise, false. The default is true.

If true, the expiration date and time of the cookie will be automatically refreshed if less than half of the value in CookieTimeout remains and the user is still actively using the application. If false, the cookie automatically times out after the interval specified in the CookieTimeout property has passed. For more information, see the HttpCookieExpires()()()() property.

CookieTimeout

A required read/write datetime value that specifies the cookie expiration time interval. The default is 69 days, 10 hours, and 40 minutes, which is equivalent to 10000 minutes.

Domain

A read/write string value that specifies the cookie domain. The default is an empty string ("").

This property allows sharing of the anonymous identification cookie across domains that have a common Domain Name System (DNS) namespace (for example, all sites that end in "contoso.com"). To share anonymous identification cookies, the sites must share common decryption and validation keys. Other anonymous identification configuration attributes, such as cookie path and cookie name, must be the same for all the sites. For more information, see the HttpCookie class.

Enabled

An optional read/write boolean value. true if anonymous identification is enabled; otherwise, false. If true, a cookie (or cookieless value) is used to manage the user's anonymous identifier. The default is false.

Location

(Inherited from ConfigurationSection.) A key property.

Path

(Inherited from ConfigurationSection.) A key property.

SectionInformation

(Inherited from ConfigurationSection.)

This class contains no subclasses.

The following table lists the possible values for the Cookieless property. The default is 1 (UseCookies).

Value

Keyword

Description

0

UseUri

Specifies that the calling feature uses the query string to store an identifier, regardless of whether the browser or device supports cookies.

1

UseCookies

Specifies that cookies are used to persist user data, regardless of whether the browser or device supports cookies.

2

AutoDetect

Specifies that ASP.NET determines whether the requesting browser or device supports cookies. If the requesting browser or device supports cookies, AutoDetect uses cookies to persist user data; otherwise, an identifier is used in the query string. If the browser or device supports the cookies, but cookies are currently disabled, the requesting feature still uses cookies.

3

UseDeviceProfile

Specifies that ASP.NET determines whether to use cookies based on the HttpCapabilitiesBaseCookies()()()() property. If the setting indicates that the browser or device supports cookies, cookies are used; otherwise, an identifier is used in the query string.

The following table lists the possible values for the CookieProtection property. The default is 1 (Validation).

Value

Keyword

Description

0

None

Specifies that the cookie information is not protected. Information in the cookie is stored in clear text and is not validated when the information is sent back to the server.

1

Validation

Ensures that the information in the cookie has not been altered before the information is sent back to the server.

2

Encryption

Encrypts the information in the cookie.

3

All

Specifies that both the Validation and Encryption values are used to protect the information in the cookie.

ConfigurationSection

   AnonymousIdentificationSection

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

Reference

SystemWebSectionGroupAnonymousIdentification()()()()
HttpCookieExpires()()()()
HttpCookieSecure()()()()
HttpCookie
HttpCookieMode

Other Resources

Community Additions

ADD
Show:
© 2014 Microsoft