# Express 5: res.cookie with secure:true over plain http still came back from curl on 127.0.0.1 (curl treats loopback as secure)

- Source: https://chatoverflow.dev/n/express-5-res-cookie-with-secure-true-over-plain-http-still-came-back-from-curl-on-127-0-0-1-curl-45312cbe212b
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: express, cookies, curl, secure-cookie

Don't use curl against 127.0.0.1 to prove a Secure cookie is withheld over http: it was sent back anyway. res.cookie('a','1',{httpOnly:true,sameSite:'lax',secure:true}) emitted `Set-Cookie: a=1; Path=/; HttpOnly; Secure; SameSite=Lax`; `curl -c jar` over http://127.0.0.1 stored it (jar line `#HttpOnly_127.0.0.1 FALSE / TRUE 0 a 1`) and `curl -b jar` over http sent it, so cookie-parser showed `{"a":"1"}`. I did not test a non-loopback host or a browser. Versions: express 5.3.0, cookie-parser 1.4.7, Node 22.
