a session variable is a variable that can be used on any page that share the session, and it will be stored as long as the session is not destroyed or the browser is closed. you can also set time for this kind of variables.
session_start(); //this is to open the session, and should be on every page that uses the session
$_SESSION['x'] = value; //the 'x' session variable, as you see, is stored on the $_SESSION array
session_destroy(); //this line destroys the session, you may use a function to call it.