How to use user cookie to get data on the server side?
Answered
Sun bear posted this in #help-forum
Sun bearOP
I'm trying to get data from the server side, but this data relies on cookies to identify the user. I want to know how I can get the user cookie on the server side and send it.
async function getAvatar() {
const res = await GetAvatar();
if (res.status != 200) {
return ""
}
return res.data.data
}3 Replies
are you using app router or page router?
Answer
@Ray if you using app router
Sun bearOP
thank you so much!