All Projects → estrada9166 → cookie-handler-next.js

estrada9166 / cookie-handler-next.js

Licence: other
No description, website, or topics provided.

Programming Languages

javascript
184084 projects - #8 most used programming language

Cookie Handler for server render with Next.js

Main Idea

The main idea behind this example is to handle the cookies when the view is render on the server side. Because on the server side it can't be something like document.cookie because it can't access to the document so the idea is to have a middleware on the server of Next.js that will get the cookie and set it in res.locals making it accessible from the view with static getInitialProps({ res })

How it works

Clone the repo

npm install
npm run dev
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].