kiwi_guest_id cookie set with Secure flag on HTTP direct access — session lost on every request #105
Labels
No labels
accessibility
backlog
beta-feedback
bug
duplicate
enhancement
feature-request
help wanted
invalid
needs-design
needs-triage
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/kiwi#105
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The
kiwi_guest_idsession cookie is always set withSecure=Truein CLOUD_MODE. When accessing the stack directly on HTTP (e.g.http://localhost:8515for developer testing), browsers refuse to send the cookie back, so every request creates a new anonymous session. Any item added in one request is invisible in the next.Steps to reproduce
http://localhost:8515in a browser (direct port, no Caddy/HTTPS)Expected
Direct HTTP access maintains session continuity for developer testing.
Actual
Set-Cookie: kiwi_guest_id=...; Secure— browser will not send this cookie on HTTP, breaking all session state.Root cause
cloud_session.py_resolve_guest_session()passessecure=CLOUD_MODEtoresponse.set_cookie(). WhenCLOUD_MODE=true,Secure=Trueregardless of the transport protocol. For production via Caddy (HTTPS) this is correct. For direct HTTP dev access it breaks sessions.Note
This does not affect production traffic via
menagerie.circuitforge.tech(served over HTTPS). It only affects developer testing via direct port. Still worth fixing to avoid confusing test results.Fix
Only set
secure=Truewhen the request itself is over HTTPS, or document that direct-port testing requires a browser with--unsafely-treat-insecure-origin-as-secureflag. Alternatively addCLOUD_AUTH_BYPASS_IPSto the dev.envso the bypass session (no cookie needed) is used for LAN testing.