[This is preliminary documentation and is subject to change.]

Sets a cookie.

Namespace: Simple.Web.HttpSimple.Web.HttpSimple::Web::Http
Assembly: Simple.Web (in Simple.Web.dll)

Syntax

C#

public static void SetCookie(

this IResponse response,

string name,

string value,

int timeOut = 0,

bool httpOnly = true,

bool secure = false,

string path = "/"

)

VB

Public Shared Sub SetCookie( _

response As IResponse, _

name As String, _

value As String, _

timeOut As Integer = 0, _

httpOnly As Boolean = True, _

secure As Boolean = False, _

path As String = "/" _

)

C++

public:

static void SetCookie(

IResponse^ response,

String^ name,

String^ value,

int timeOut = 0,

bool httpOnly = true,

bool secure = false,

String^ path = L"/"

)

Parameters

name
Type: System.StringSystem.StringSystem::String
The name of the cookie to set.
value
Type: System.StringSystem.StringSystem::String
The value of the cookie to set.
timeOut
Type: System.Int32System.Int32System::Int32
The time (in seconds) after which the cookie expires.
httpOnly
Type: System.BooleanSystem.BooleanSystem::Boolean
A flag indicating whether the cookie is readable only via HTTP (i.e., not by client-side script). Default is true.
secure
Type: System.BooleanSystem.BooleanSystem::Boolean
A flag indicating whether the cookie should only be sent over HTTPS. Default is false.
path
Type: System.StringSystem.StringSystem::String
The path below which the cookie applies.

See Also

ResponseExtensionsResponseExtensionsResponseExtensions Class
Simple.Web.HttpSimple.Web.HttpSimple::Web::Http Namespace