Courses / Node.js
34. Cookie handling and secure cookie flags
Set and read HTTP cookies, and apply secure attributes (HttpOnly, Secure, SameSite).
JavaScript
Cookie handling and secure cookie flags
Cookies store small pieces of data in the browser that servers and client code can read and set for session/state handling.
"I need to remember who the user is across requests but keep their session safe from theft."
HTTP cookies are name=value pairs sent in request/response headers; secure attributes like HttpOnly, Secure, and SameSite control who can read them and when they're sent.
"I need to remember who the user is across requests but keep their session safe from theft."
HTTP cookies are name=value pairs sent in request/response headers; secure attributes like HttpOnly, Secure, and SameSite control who can read them and when they're sent.