Class: Cookie

Cookie(name, opt_pathnullable)

Represents a cookie.

This is an object, that way you set the name just once so calling set or get you don't have to worry about getting the name wrong.

Parameters:
Name Type Attributes Description
name string

of cookie

opt_path string <nullable>

path for cookie. Default "/"

Source:
Example
var fooCookie = new Cookie("foo");
    var value = fooCookie.get();
    fooCookie.set(newValue);
    fooCookie.erase();

Methods

erase()

Erases the cookie.

Source:

get() → (nullable) {string}

Gets the value of the cookie

Source:
Returns:

value of cookie

Type
string

set(value, opt_daysnullable)

Sets the cookie

Parameters:
Name Type Attributes Description
value string

value for cookie

opt_days number <nullable>

number of days until cookie expires. Default = none

Source: