How to access client side browser cookies ?
Answered
Black-bellied Whistling-Duck posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Black-bellied Whistling-DuckOP
I want to access cookie in client side components.
5 Replies
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
any cookie library will work
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Black-bellied Whistling-DuckOP
If I use
document.cookie
method then I get document is not defined error.![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
European sprat
Client components are still pre rendered on the server so you'll need to make sure you check that document exists and/or have it in a useEffect or event handler
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Black-bellied Whistling-DuckOP
ok