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

.NET Framework 4.6 and 4.5

Writes a cookie associated with the specified request that has the specified name, value, and expiration time.

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

public void Write(
	byte[] value,
	string name,
	DateTime expirationTime,
	HttpContext context
)

Parameters

value
Type: System.Byte[]

The cookie value.

name
Type: System.String

The name of the cookie.

expirationTime
Type: System.DateTime

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

context
Type: System.Web.HttpContext

The HttpContext for the request.

ExceptionCondition
ArgumentNullException

value is null or empty.

ArgumentException

name is null or empty.

The cookie domain and path are specified by the Domain and Path properties. The request is specified by Current. Whether the cookie should be sent only over SSL is specified by the RequireSsl property and whether the cookie should be hidden from client-side scripts is specified by the HideFromClientScript property.

.NET Framework

Supported in: 4.6, 4.5
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft