7 Replies
I believe you can use cookies
+1 for cookies
the traditional way of how cookies work ?
server -->client <-->server ,
Yes you can use cookies from "next/headers"
and get the cookie you want, in my case I am trying to extract the token and decode then get the user id
But the problem I am facing now is how to access these data from a client component
I am thinking about creating a provider in the top layout and pass the id in it
But I don't know how :lol
here is some simple code to build that provider and get the id.
setting up of the provider:
session-provider.tsx
example usage:
providers.tsx
@Jacob Thank you so much
All good