Next.js Discord

Discord Forum

Async Cookies

Unanswered
Curlew Sandpiper posted this in #help-forum
Open in Discord
Curlew SandpiperOP
Hey,
First of all, I've recently joined here, nice to meet you all 😁

So I have a pain that I really don't know how to handle. My company recently decided to migrate to Next.js 15 and I have a pain with cookies.
Our component tree is kinda big and I was wondering if there is any trick to access cookies at demand without needing to make a component async or prop drill the cookie for 5 levels?

Thanks for your support!

1 Reply

@Curlew Sandpiper Hey, First of all, I've recently joined here, nice to meet you all 😁 So I have a pain that I really don't know how to handle. My company recently decided to migrate to Next.js 15 and I have a pain with cookies. Our component tree is kinda big and I was wondering if there is any trick to access cookies at demand without needing to make a component async or prop drill the cookie for 5 levels? Thanks for your support!
if it is a server component: just make it async. if you used cookies in next 14, migrating to next 15 is as simple as adding async where needed. async components can be used inside sync components just fine as long as both are server component

if it is a client component, there are no breaking changes on that side. past code should continue to work normally