Set-Cookie: Server tells the browser to store a cookie. Can include flags like HttpOnly, Secure, SameSite. Set-Cookie is the response header a server uses to tell the browser to store a cookie, such as Set-Cookie: session=abc; HttpOnly; Secure; SameSite=Lax; Path=/. The flags matter for security. HttpOnly stops JavaScript from reading the cookie, which protects session cookies from being stolen through cross-site scripting. Secure sends the cookie only over HTTPS. SameSite=Lax or Strict limits when the cookie is sent with requests from other sites, which helps against cross-site request forgery.
Set an expiry with Max-Age or Expires, or the cookie disappears when the browser closes. Keep cookies small and few, because they travel with every request to your domain. Frameworks like Laravel set sensible defaults for session cookies, but check them, especially Secure in production.
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems. Use when implementing auth systems, securing APIs, or debugging security issues.
Use when reviewing or setting HTTP response headers for a web app or API - security headers (Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy), CORS headers, caching headers (Cache-Control, ETag, Last-Modified, Vary) and cookies (Set-Cookie flags). Also use when a security scan reports missing headers.
OWASP Top 10 security audit and secure coding guidelines for Laravel + React/Inertia.js applications. Use when auditing for vulnerabilities ("run OWASP audit", "security review", "check my app security") or writing secure Laravel code involving auth, payments, file uploads, or API design. Triggers on security-related tasks, payment handling, authentication, or any request to audit a Laravel codeba