This page shows an example of how to create session variables in PHP. Once we have created this variable, we can read it on this page.
In order to be able to use session variables, we need to tell PHP that we want to use sessions on this page. To do this, we call the session_start() built-in function at the top of the script. The following is the code that we used on this page to create the variable:
<?php //start PHP session session_start(); //create a session variable $_SESSION['test_variable'] = "this is the value of the test variable"; ?>