Skip to content

Instantly share code, notes, and snippets.

@thatanjan
Last active December 7, 2021 22:23
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 thatanjan/44246988c063d881d24eb9cbbcd13b2a to your computer and use it in GitHub Desktop.
Save thatanjan/44246988c063d881d24eb9cbbcd13b2a to your computer and use it in GitHub Desktop.
Access cookies in nextjs from server side
import { GetServerSideProps } from 'next'
export const getServerSideProps: GetServerSideProps = async (ctx) => {
const { req, res } = ctx
const {cookies} = req
return { props: { } }
}
@taperodev
Copy link

Very good this code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment