plandex-ai/plandex · error
Error setting auth cookie:
Error message
Error setting auth cookie:
What it means
HTTP 500 error returned by CreateOrgHandler when SetAuthCookieIfBrowser fails to attach the session cookie (for browser-based clients) tying the authenticated user to the newly created org. The org itself has already been created and the response marshalled, but the error prevents the cookie from being set, so the client cannot be associated with the new org session; the marshalled response is never written.
Source
Thrown at app/server/handlers/orgs.go:157
return
}
resp := shared.CreateOrgResponse{
Id: org.Id,
}
bytes, err := json.Marshal(resp)
if err != nil {
log.Printf("Error marshalling response: %v\n", err)
http.Error(w, "Error marshalling response: "+err.Error(), http.StatusInternalServerError)
return
}
err = SetAuthCookieIfBrowser(w, r, auth.User, "", org.Id)
if err != nil {
log.Printf("Error setting auth cookie: %v\n", err)
http.Error(w, "Error setting auth cookie: "+err.Error(), http.StatusInternalServerError)
return
}
log.Println("Successfully created org")
w.Write(bytes)
}
func GetOrgSessionHandler(w http.ResponseWriter, r *http.Request) {
log.Println("Received request for GetOrgSessionHandler")
auth := Authenticate(w, r, true)
if auth == nil {
return
}
org, apiErr := getApiOrg(auth.OrgId)View on GitHub (pinned to e2d772072e)
Solutions
- Check the wrapped cookie error in server logs
- Verify cookie signing secret/config is set
- Retry; the org exists so only session setup is affected
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at app/server/handlers/orgs.go:157 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/0007499bbea48e98.
Report an issue: GitHub.