Skip to content
Playground(another site)

bynk.http.cookie_secure_prefix

Error A __Secure- cookie literal is not secure.

A cookie named __Secure-… asks the browser to accept it only over HTTPS, and a browser drops one that is not Secure, so a literal with secure: false would never arrive. It is refused instead. Remove secure: false; the default is secure: true. A __Host- name is stricter: bynk.http.cookie_host_prefix.

Example

Created("ok").withCookie(Cookie { name: "__Secure-sid", value: "a", secure: false }) // ✗
Created("ok").withCookie(Cookie { name: "__Secure-sid", value: "a" }) // ✓

In the Book

See also

  • The grammar rule it governs: http_handler.
  • Every code in its category, HTTP, on the diagnostic index.
  • bynk explain bynk.http.cookie_secure_prefix shows the same from the installed toolchain, without a network.