Elementals.js

Latest Version: 3.0 RC 1 17 July 2017

Method _.Cookies.setExpiresAfter

Summary:

Sets a browser cookie that expires after a specified number of milliseconds

You can pass any loose 'false' value to optional parameters to skip them if desired to get at the deeper nested ones.

Calling Convention:
_.Cookies.setExpiresAfter(name, value, time[, path[, domain[, secure]]])
Parameters:
name
The cookie's name
value
Value to set on the cookie
time
Expire cookie after this many milliseconds
path optional
The path to which the cookie is applied. If omitted or loose false, it will apply to all paths on the domain.
domain optional
The domain the cookie is for. If omitted or loose false, the current domain is assumed.
secore optional
Loose boolean, if set the cookie will only apply to SSL/TLS connections -- aka when served via HTTPS instead of HTTP.
Returns:
Nothing

Advertisement