PHP-Sessions Login Logout example
PHP-Sessions Login Logout System This tutorial explains you How to use session in Login logout module using PHP . To implement this module, we are going to use the following files. session_login.html session_login.php welcome.php logout.php First create a project folder in server (htdocs/www) and create the files as shown in the below. Next, open the session_login.html in browser and type user : admin and pwd: admin and click login button. Then it is redirected to login.php page, login.php compares the values given in form with the values given in the if condition, if they are similar it stores user value in session and redirected to welcome page. Welcome page( welcome.php) checks user is set or not in session. If yes, then it greets with the message "hello admin you are logged in" and also displays a link to logout. If you click logout page unsets user value and destroys the session and redirects to the welcome page. Welcome page again checks if the user is