asp.net.ph

HttpCookiesSection Class

System.Web.Configuration Namespace


.NET Framework version 2.0

Configures properties for cookies used by a Web application.

HttpCookiesSection Class Members

Collapse   Constructors

Visibility Constructor Parameters
public HttpCookiesSection ( )

Collapse   Properties

Visibility Name Value Type Accessibility
public Domain String [ Get , Set ]
public HttpOnlyCookies Boolean [ Get , Set ]
public RequireSSL Boolean [ Get , Set ]
public SameSite SameSiteMode [ Get , Set ]

Remarks

NOTE: This member is used internally by the .NET infrastructure and is not intended to be called directly from your code.

The HttpCookiesSection class provides a way to programmatically access and modify the httpCookies section of a configuration file.

It defines the settings applied by default to all cookies issued by the application, unless the code issuing the cookie overrides them.

One objective of the httpCookies element is to support the use of HttpOnly cookies. HttpOnly cookies ( cookies with the HttpOnly attribute ) were introduced in Internet Explorer 6 to help mitigate the risk of cross-site scripting. The HttpOnly attribute prevents cookies from being accessed through client-side script. Any information contained in an HttpOnly cookie is less likely to be disclosed to a hacker or a malicious Web site. For more information, search MSDN ( msdn.microsoft.com ) for "HttpOnly."

NOTE: The HttpCookiesSection can read and write information from and to the related section of the configuration file according to the section property AllowDefinition whose value is Everywhere.

Example

The following code example shows how to obtain the HttpCookiesSection object from the configuration file of an existing Web application.

// Get the Web application configuration.
System.Configuration.Configuration webConfig =
   WebConfigurationManager.OpenWebConfiguration ( "/aspnetTest" );

// Get the section.
string configPath = "system.web/httpCookies";
System.Web.Configuration.HttpCookiesSection httpCookiesSection =
  ( System.Web.Configuration.HttpCookiesSection )webConfig.GetSection ( configPath );
  C# VB

See Also

ASP.NET Configuration   <httpCookies> Section Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph