Skip to content

Instantly share code, notes, and snippets.

@onedebos
Created October 29, 2020 10:57
Show Gist options
  • Save onedebos/15b6b42179b1f21aac65db9f7158649e to your computer and use it in GitHub Desktop.
Save onedebos/15b6b42179b1f21aac65db9f7158649e to your computer and use it in GitHub Desktop.
Parsing cookies helper
// helpers/index.js
import cookie from "cookie"
export function parseCookies(req) {
return cookie.parse(req ? req.headers.cookie || "" : document.cookie)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment