A simple login system that demonstrates the "Remember Me" functionality to allow users to stay signed in.
- User login with username and password
- "Remember Me" checkbox to save login credentials
- User signup form
- Responsive design
The "Remember Me" feature works by:
- When a user checks the "Remember Me" box and logs in, their username is stored in the browser's localStorage
- When the user returns to the login page, the stored username is automatically filled in
- The "Remember Me" checkbox is also checked to indicate the preference
- For security reasons, the actual password is not stored (in a real application, you would use tokens instead)
index.html- The login page with the "Remember Me" checkboxstyles.css- Styling for the login and signup pagesscript.js- JavaScript code that handles the "Remember Me" functionalitysignup.html- A simple signup pagesignup.js- JavaScript code for the signup page
In a production environment, you should:
- Never store passwords in localStorage or cookies
- Use secure HTTP-only cookies for authentication tokens
- Implement proper server-side authentication
- Use HTTPS to encrypt data transmission
- Consider using OAuth or other secure authentication protocols
- Open
index.htmlin your web browser - Enter a username and password
- Check the "Remember Me" checkbox if you want to stay signed in
- Click the Login button
When you return to the page later, your username will be pre-filled if you checked "Remember Me".