Since the session has been established, you can test the availability of persistence for the user name and user ID. For this, let's create a small script called status.php. This script calls the session_start() function. Since the session cookie is already available in the client machine, calling the session_start() function looks at the session.
ID and loads the appropriate session variables with
pr~vious values on the server machine. Hence, calling $_SESSION('username'j or $_SESSION['id'j will retrieve the data stored through the login.php script file. The following is what the status.php script looks like:
The status script can be accessed by clicking on the 'Check Status' link on the login page. It displays the user name and user ID obtained from the session data. This fulfills the basic requirement of a session, since it permits persistence of data across different pages after login.