JAVASCRIPT
Cookie Utilities
All samples are using Ink.requireModules
, please read how to use it at Ink.requireModules section
Function name | Description |
---|---|
.get([name]) | Gets an object with the current page cookies, or a specific cookie if you specify the name . |
.remove(cookieName, [path], [domain]) | Deletes a cookie. |
.set(name, value, [expires], [path], [domain], [secure]) | Sets a cookie. |
Gets an object with the current page cookies, or a specific cookie if you specify the name
.
name
The cookie name.Code
Deletes a cookie.
cookieName
Cookie name.path
Path of the cookie. Defaults to '/'.domain
Domain of the cookie. Defaults to current hostname.Code
Remove a cookie setted with path and domain
Code
Sets a cookie.
name
Cookie name.value
Cookie value.expires
Number of seconds the cookie will be valid for.path
Path for the cookie. Defaults to '/'.domain
Domain for the cookie. Defaults to current hostname.secure
Flag for secure. Default 'false'.Set a cookie that expires in one day
Code
Set a session cookie
in path /
of top damain
Code