Skip to content
Playground(another site)

bynk.actor.signed_cookie_unprefixed

Warning A SignedCookie cookie does not start with __Host- (warning).

A __Host- cookie name tells the browser to keep the cookie only if it is Secure, host-only and Path=/, so a sibling subdomain cannot set or overwrite it. An unprefixed session cookie is open to cookie tossing from any subdomain, which is rarely intended. The default is __Host-session; drop cookie or give it a __Host- name.

Example

actor User { auth = SignedCookie(secret = "SESSION_KEY", ttl = 12.hours, cookie = "session"), identity = UserId } // ⚠ not `__Host-`
actor User { auth = SignedCookie(secret = "SESSION_KEY", ttl = 12.hours), identity = UserId } // ✓ `__Host-session` by default

In the Book

See also

  • Every code in its category, Actors, on the diagnostic index.
  • bynk explain bynk.actor.signed_cookie_unprefixed shows the same from the installed toolchain, without a network.