Skip to content

Instantly share code, notes, and snippets.

View damianryann's full-sized avatar
🎯
Focusing

Damian Ryan damianryann

🎯
Focusing
  • United Kingdom
  • 12:51 (UTC +01:00)
View GitHub Profile
@damianryann
damianryann / cookies.js
Created May 12, 2021 09:32 — forked from wizard04wsu/cookies.js
Methods for working with cookies
//If cookies are not supported by the browser, `Cookies` will be undefined
//Cookies.set(name, value[, options])
// creates, modifies, or removes a cookie
// `options` may be an object including `expires`, `path`, `domain`, and/or `secure`
// `options.expires` can be either a Date object or the number of seconds until it should expire
// (0 or undefined indicates end of session, <0 removes the cookie, Infinity sets it to 50 years)
//
//Cookies.get(name)
// returns the value of the first cookie with that name