Explain how to design secure authentication flows in MERN using HTTP-Only cookies and JWT.
expand_more
httpOnly: true (prevents JS access), secure: true (requires HTTPS), and sameSite: 'strict'.
2. Frontend: Configure client libraries (like fetch or axios) to set { credentials: 'include' } or withCredentials: true to send cookies automatically with API requests, keeping session tokens safe from XSS.