graphql/yoga-server/docs/features/cookies #2627
Replies: 11 comments 17 replies
-
I have did this but there seems to be a problem with the |
Beta Was this translation helpful? Give feedback.
-
Iam using this plugin but it set the cookie as non http-only cookie how can i set it as http-only cookie |
Beta Was this translation helpful? Give feedback.
-
Is possibility to apply a signature on the cookie? |
Beta Was this translation helpful? Give feedback.
-
As a batterie included solution why not implement cookie management inside yoga ? Feels a bit clunky at the moment. |
Beta Was this translation helpful? Give feedback.
-
I'd rewrite that to be:
User or client recognition is just one use case for cookies. 😁 Scott |
Beta Was this translation helpful? Give feedback.
-
trying the following await this.context.request.cookieStore?.set('refresh_token', { but the headers isn't getting created properly. Set-Cookie: refresh_token=%5Bobject%20Object%5D; Path=/; SameSite=Strict any thoughts? I feel like I'm just missing somehting obvious, but I've looked through the API docs, can't see what the issue is here. None of the cookie settings are coming through. I can confirm the response headers before sent to cleint are the same. this is the header coming stright out of yoga |
Beta Was this translation helpful? Give feedback.
-
This seems to nok work with Pothos. Currently, I have the issues that cookies are not flushed to the client and saved across requests. |
Beta Was this translation helpful? Give feedback.
-
I cannot seem to get this to work. Tried the solutions in the thread. I can access the CookieStore without issue, but calling Is anyone able to successfully use this plugin? I am running |
Beta Was this translation helpful? Give feedback.
-
Does this have typescript support? |
Beta Was this translation helpful? Give feedback.
-
Hello! I am having issues receiving the cookie in my frontend. It appears no cookie gets received or set. In my backend, I have something like: // ...
await cookieStore.set({
name: 'refreshToken',
value: refreshToken,
expires: Date.now( ) + MAX_COOKIE_AGE_IN_SECONDS,
domain: null,
httpOnly: true,
// sameSite: 'lax', // 'none' | 'lax' | 'strict'
})
console.info((await cookieStore.get('refreshToken')))
// Return the access token to the backend system.
return accessToken In my frontend, I have something like: /**
Uses the given access token to request
the current user's data.
**/
const getMe = async (params: GetMeParams) => {
const response = await request(
backendUrl,
getMeQuery,
{ },
{
Authorization: `Bearer ${params.accessToken}`,
},
)
return response.getMe
} Clearly, my refresh token is getting set as a token on the backend (as I've seen posts claiming I need to set up my cors headers correctly, using something like |
Beta Was this translation helpful? Give feedback.
-
graphql/yoga-server/docs/features/cookies
GraphQL Yoga Documentation
https://the-guild.dev/graphql/yoga-server/docs/features/cookies
Beta Was this translation helpful? Give feedback.
All reactions