Click or drag to resize

CookieExtensionsAddCookie Method (HttpResponse, String, String, String, Int32)

Create a cookie and add it to the response. Note that you should use AddCookie(HttpResponse, String, String, CookieAttrs, String, Int32) if the cookie should be Secure or if the cookie value might contain characters invalid in a cookie value.

Namespace:  NetQuarry.Net
Assembly:  EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax
public static void AddCookie(
	this HttpResponse response,
	string name,
	string value,
	string domain = null,
	int expiresDays = 0
)

Parameters

response
Type: System.WebHttpResponse
The response.
name
Type: SystemString
The cookie name.
value
Type: SystemString
The cookie value.
domain (Optional)
Type: SystemString
The optional cookie domain.
expiresDays (Optional)
Type: SystemInt32
The optional cookie expiration, in days from the current date. This is set on the cookie only if non-zero.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HttpResponse. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also