getServerAuthSession call in createTRPCContext.unstable_httpBatchStreamLink which streams the response (same streaming RSC), so you can't set a cookie with tRPC.createTRPCContext is run prior to sending the initial response. This is the only way I could imagine this works. createTRPCContext is run "for each invocation of tRPC". However, that does not suggest that it is run prior to sending the initial response.