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: '/'
      })
    })
})

I'm using svelte-kit, but this doesn't set the cookie
Was this page helpful?