Session

The session is use to store user information for use later.Normally the information that store are username and password.The information is temporary and will be deleted when user close the browser or left the website

Example of session:

session_start(); // start up your PHP session!

$_SESSION[username]=$_POST[username]; //stored the username session from the form

Use isset to check the session:

if (isset($_SESSION[username])){
header ('Location: home.php');
}


Destroy session:

session_destroy();

0 comments:

Post a Comment