tRPCttRPC
Powered by
propP
tRPCβ€’3y agoβ€’
7 replies
prop

cookies not being set in procedure

This is all the code for setting my cookie
import { publicProcedure, router, userProcedure } from '$lib/trpc/t'

export const user = router({
  testCookie: publicProcedure
    .query(async ({ ctx: { cookies } }) => {
      cookies.set("name", "value", {
        path: '/'
      })
    })
})
import { publicProcedure, router, userProcedure } from '$lib/trpc/t'

export const user = router({
  testCookie: publicProcedure
    .query(async ({ ctx: { cookies } }) => {
      cookies.set("name", "value", {
        path: '/'
      })
    })
})

I'm using svelte-kit, but this doesn't set the cookie
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How do you set headers or cookies in procedure ?
codeforkCcodefork / ❓-help
3y ago
Next cookies() not being set on Mutation in App Dir (T3 Turbo)
IceAge2OnDVDIIceAge2OnDVD / ❓-help
3y ago
Set cookie header in procedure middleware
ivanIivan / ❓-help
6mo ago
AWS Lambda / How to set Cookies inside Procedures
AHeissenbergerAAHeissenberger / ❓-help
3y ago