Skip to content

Files

Latest commit

 

History

History
29 lines (18 loc) · 1.11 KB

cookies.md

File metadata and controls

29 lines (18 loc) · 1.11 KB

Cookies

Deprecated since 3.x

Create, Read and Deletes cookies.

import { cookies } from "@runroom/purejs";

Methods

get('cookie-name')

The get method returns the cookie value if exists, otherwise it returns an empty value.

set('cookie-name', 'value', days)

The set method created a cookie. Parameters are name (string),

Parameters Description
name {string} * Mandatory. The name for the cookie.
value {n} The value can be any type of value. Default is 1
days {integer} The days that the cookie will be available, by default is one year because of legal issues. Default is 365

remove('cookie-name')

The remove method removes the created cookie.