Skip to content

Instantly share code, notes, and snippets.

@jaredreich
Created October 2, 2016 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredreich/7d1cf38d8d9a8b1b2a2ba1f8e2ba5d0e to your computer and use it in GitHub Desktop.
Save jaredreich/7d1cf38d8d9a8b1b2a2ba1f8e2ba5d0e to your computer and use it in GitHub Desktop.
const cookies = {
set: (name, value, days) => {
const date = new Date()
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000))
const expires = 'expires=' + date.toUTCString()
document.cookie = name + '=' + value + '; ' + expires
},
get: () => {
console.log('get')
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment