Constructor
new $k.NewCookie(name, value)
Creates a new cookie
Name | Type | Description |
---|---|---|
name | string | |
value | string |
- Since
- 4.0.0
Extends
Methods
comment() → {string|undefined}
Returns the comment of the cookie
- Since
- 4.0.0
- Type:
- string |
undefined
domain() → {string|undefined}
Returns the domain of the cookie
- Since
- 4.0.0
- Type:
- string |
undefined
expiry() → {Date|undefined}
Returns the expiry date of the cookie
- Since
- 4.0.0
- Type:
- Date |
undefined
httpOnly() → {boolean}
Returns true if the cookie contains the HttpOnly attribute
- Since
- 4.0.0
- Type:
- boolean
maxAge() → {number|undefined}
Returns the maximum age of the the cookie in seconds
- Since
- 4.0.0
- Type:
- number |
undefined
name() → {string}
Returns the name of the cookie
- Since
- 4.0.0
- Inherited From
- Type:
- string
path() → {string|undefined}
Returns the path of the cookie
- Since
- 4.0.0
- Type:
- string |
undefined
port() → {number|undefined}
Returns the port of the cookie
- Since
- 4.0.0
- Type:
- number |
undefined
secureOnly() → {boolean}
Returns true if the cookie will only be sent over a secure connection
- Since
- 4.0.0
- Type:
- boolean
setComment(comment)
Sets the comment of the cookie
Name | Type | Description |
---|---|---|
comment | string |
- Since
- 4.0.0
setDomain(domain)
Sets the domain of the cookie
Name | Type | Description |
---|---|---|
domain | string |
- Since
- 4.0.0
setExpiry(expiryDate)
Sets the expiry date of the cookie
Name | Type | Description |
---|---|---|
expiryDate | Date |
- Since
- 4.0.0
setHttpOnly(httpOnlyopt)
Set the HttpOnly attribute
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
httpOnly | boolean | <optional> | true | True if undefined |
- Since
- 4.0.0
setMaxAge(maxAge)
Sets the maximum age of the the cookie in seconds
Name | Type | Description |
---|---|---|
maxAge | number |
- Since
- 4.0.0
setPath(path)
Sets the path of the cookie
Name | Type | Description |
---|---|---|
path | string |
- Since
- 4.0.0
setPort(port)
Sets the port of the cookie
Name | Type | Description |
---|---|---|
port | number |
- Since
- 4.0.0
setSecureOnly(secureOnlyopt)
Set if the cookie will only be sent over a secure connection
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
secureOnly | boolean | <optional> | true | True if undefined |
- Since
- 4.0.0
setVersion(version)
Sets the version of the cookie
Name | Type | Description |
---|---|---|
version | number |
- Since
- 4.0.0
- Deprecated
- This function is deprecated and might be removed in future releases
value() → {string}
Returns the value of the cookie
- Since
- 4.0.0
- Inherited From
- Type:
- string
version() → {number|undefined}
Returns the version of the cookie
- Since
- 4.0.0
- Deprecated
- This function is deprecated and might be removed in future releases
- Type:
- number |
undefined