Closed sagedemage closed 1 year ago
With the provided code modifications, I have implemented sessions for user authentication, and users can log in, maintain their session, and log out. Cookies are also managed automatically as part of the session mechanism.
Implemented session management to authenticate and remember logged-in users.
Created a logout.php file to handle the logout process and redirect users to the login page
Linked the "Logout" button in the logout.html page to the logout.php file which when the user clicks, it takes them to the login page
Stored user-specific information in the session for a personalized user experience. I added the setcookie function to create a session cookie named "user_id" that will expire after 1 hour(3600 seconds). The session cookie will be set when the user logs in successfully.
Updating the logout page
Updated Logout page
Adding more pages to the nav bar
I added the setcookie function to create a session cookie named "user_id" that will expire after 1 hour(3600 seconds). The session cookie will be set when the user logs in successfully.
After a successful registration, it redirects the user to the login page
After the user logs in, it redirects to the dashboard
Cookie Session
Create a cookie session system to persist authentication for a user.
Tasks