new 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
- Type:
- string
domain() → {string}
Returns the domain of the cookie
- Type:
- string
expiry() → {date}
Returns the expiry date of the cookie
- Type:
- date
httpOnly() → {boolean}
Returns true if the cookie contains the HttpOnly attribute
- Type:
- boolean
maxAge() → {number}
Returns the maximum age of the the cookie in seconds
- Type:
- number
name() → {string}
Returns the name of the cookie
- Inherited From
- Type:
- string
path() → {string}
Returns the path of the cookie
- Type:
- string
port() → {number}
Returns the port of the cookie
- Type:
- number
secureOnly() → {boolean}
Returns true if the cookie will only be sent over a secure connection
- Type:
- 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(httpOnlyopt)
Set the HttpOnly attribute
Name | Type | Attributes | 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(secureOnlyopt)
Set if the cookie will only be sent over a secure connection
Name | Type | Attributes | Description |
---|---|---|---|
secureOnly | boolean | <optional> | True if undefined |
setVersion(version)
Sets the version of the cookie
Name | Type | Description |
---|---|---|
version | number |
value() → {string}
Returns the value of the cookie
- Inherited From
- Type:
- string
version() → {number}
Returns the version of the cookie
- Type:
- number