Across Days 74 and 75 of a 100-day MERN Stack project, the developer expands the MFLIX app’s user authentication flow. On Day 74, they implement a production-ready sign-up endpoint in Express at /signup. The backend accepts sign-up form fields (name, email, password, and confirmPassword), parses req.body payloads, validates that password and confirmPassword match, and then creates a new user document using a MongoDB-backed User model. Successful registrations redirect to /login; failures return either a validation error rendered on the sign-up page or a server error response.

On Day 75, the focus shifts to login and session persistence. The developer builds a high-fidelity login interface with a “Welcome Back” card and a /signup-to-/login navigation flow. For authentication at /login, the backend queries MongoDB by email, verifies the supplied password, and then initializes an authenticated session. Instead of relying on in-memory session handling, they add a MongoDB session store using express-session with a MongoDB-backed driver (connect-mongo). This setup writes session data to a dedicated MongoDB collection and includes session and cookie lifetimes (e.g., TTL and maxAge) to keep users logged in across server restarts.