cookie
The cookie object provides functions for creating, retrieving, or removing site cookies.
Methods
get
pb.cookie.get(cookieKey)
Retrieves the cookie information for a single cookie
Returns: string
- Returns the cookie value specified by the key.
Param | Type | Description |
---|---|---|
cookieKey | string | The key that identifies the cookie information to be retrieved. |
set
pb.cookie.set(cookieKey, value, [options])
Sets the information for a single cookie, or creates a new cookie.
Returns: string
- Returns the cookie that was set.
Param | Type | Default | Description |
---|---|---|---|
cookieKey | string | The key that identifies the cookie information to be retrieved. | |
value | string | The value to which to set this cookie. | |
[options] | Object | Additional options: | |
[options.expires] | String | Number | Date | Must be either the string 'never', a number of days, or a JavaScript Date object. | |
[options.path] | string | The cookie's path. | |
[options.domain] | string | The cookie's domain. | |
[options.secure] | Boolean | false | True means the cookie will be marked 'secure'. |
remove
pb.cookie.remove(key)
Remove a cookie
Param | Type | Description |
---|---|---|
key | string | The key that identifies the cookie to be removed. |