Skip to content

Instantly share code, notes, and snippets.

@think2011
Created September 7, 2017 20:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save think2011/d1583a5df922f3144a4757113d8b139a to your computer and use it in GitHub Desktop.
提取cookie
// 提取cookie
((cookies) => {
window.COOKIES = cookies.reduce((cur, next) => {
const [k, v] = next.split('=')
cur[k] = v
return cur
}, {})
})(document.cookie.split('; '))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment