WriteCore Method
Collapse the table of content
Expand the table of content

CookieHandler.WriteCore Method (Byte[], String, String, String, DateTime, Boolean, Boolean, HttpContext)

.NET Framework (current version)

When overridden in a derived class, writes a cookie associated with the specified request that has the specified name, value, domain, path, expiration time, persistence and visibility.

Namespace:   System.IdentityModel.Services
Assembly:  System.IdentityModel.Services (in System.IdentityModel.Services.dll)

protected abstract void WriteCore(
	byte[] value,
	string name,
	string path,
	string domain,
	DateTime expirationTime,
	bool secure,
	bool httpOnly,
	HttpContext context


Type: System.Byte[]

The cookie value.

Type: System.String

The name of the cookie.

Type: System.String

The path for the cookie

Type: System.String

The domain for the cookie

Type: System.DateTime

The expiration time for the cookie, or MinValue for a session (session-only) cookie.

Type: System.Boolean

true if the cookie should only be used over an SSL connection; otherwise, false.

Type: System.Boolean

true if the cookie should be hidden from client script; otherwise, false.

Type: System.Web.HttpContext

The HttpContext for the request.

Called from the overloaded Write methods to do the actual work of writing the cookie. The Write methods will ensure that value is a non-empty byte array and that name and path are non-empty strings.

Notes to Inheritors:

You must override this method. The implementation is entirely up to the developer. In the typical case, implementations write the cookie data to the HttpResponse.Cookies collection, however, this is not a requirement. Most parameters of the method are typically used to set equivalent properties on one or more HttpCookie objects.

.NET Framework
Available since 4.5
Return to top
© 2016 Microsoft