Let’s learn how to set/remove cookies both in the browser but also on the server in Next.js. This will allow us to create HttpOnly cookies, perfect for storing sensitive data such as authentication tokens.
———- Course
Want to go deeper with Next.js? Join me in my Next Level Next.js course where over 29 videos and 8 hours of content we’ll build a full application from start to finish. We use TypeScript, GraphQL, Prisma, Apollo, Mapbox, Firebase and lots more. https://next.leighhalliday.com/
———- Links
Source Code – https://github.com/leighhalliday/nextjs-cookies
Starting Code – https://github.com/leighhalliday/nextjs-cookies/tree/14bff7ecc64cae5f72d3f6b5ad8b2837ce6ebe1f
Same Site Cookies – https://web.dev/samesite-cookies-explained/
———- Connect
Join this channel – https://www.youtube.com/channel/UCWPY8W-FAZ2HdDiJp2RC_sQ/join
Join me on Discord – https://discord.gg/wcSNwfu
———- Timeline
00:00 – Client Side Cookies in React
02:15 – Reading Cookies Server Side Next.js
04:45 – Server Side Cookies in Next.js