new $k.NewCookie(name, value)
Creates a new cookie
| Name | Type | Description |
|---|---|---|
name |
string | |
value |
string |
Represents a new HTTP Cookie (RFC 2109) that can be added to a response |
Extends
Methods
comment() : string
Returns the comment of the cookie
Returns:
| Type | Description |
|---|---|
| string |
domain() : string
Returns the domain of the cookie
Returns:
| Type | Description |
|---|---|
| string |
expiry() : date
Returns the expiry date of the cookie
Returns:
| Type | Description |
|---|---|
| date |
httpOnly() : boolean
Returns true if the cookie contains the HttpOnly attribute
Returns:
| Type | Description |
|---|---|
| boolean |
maxAge() : number
Returns the maximum age of the the cookie in seconds
Returns:
| Type | Description |
|---|---|
| number |
path() : string
Returns the path of the cookie
Returns:
| Type | Description |
|---|---|
| string |
port() : number
Returns the port of the cookie
Returns:
| Type | Description |
|---|---|
| number |
secureOnly() : boolean
Returns true if the cookie will only be sent over a secure connection
Returns:
| Type | Description |
|---|---|
| boolean |
setComment(comment)
Sets the comment of the cookie
| Name | Type | Description |
|---|---|---|
comment |
string |
setDomain(domain)
Sets the domain of the cookie
| Name | Type | Description |
|---|---|---|
domain |
string |
setExpiry(expiryDate)
Sets the expiry date of the cookie
| Name | Type | Description |
|---|---|---|
expiryDate |
date |
setHttpOnly(httpOnly)
Set the HttpOnly attribute
| Name | Type | Description |
|---|---|---|
httpOnly |
boolean |
optional
True if undefined |
setMaxAge(maxAge)
Sets the maximum age of the the cookie in seconds
| Name | Type | Description |
|---|---|---|
maxAge |
number |
setPath(path)
Sets the path of the cookie
| Name | Type | Description |
|---|---|---|
path |
string |
setPort(port)
Sets the port of the cookie
| Name | Type | Description |
|---|---|---|
port |
number |
setSecureOnly(secureOnly)
Set if the cookie will only be sent over a secure connection
| Name | Type | Description |
|---|---|---|
secureOnly |
boolean |
optional
True if undefined |
setVersion(version)
Sets the version of the cookie
| Name | Type | Description |
|---|---|---|
version |
number |
version() : number
Returns the version of the cookie
Returns:
| Type | Description |
|---|---|
| number |