2 /// This is a tiny standalone diagnostic script to test that sessions
3 /// are working correctly on a given server.
5 /// Just run it from a browser. The first time you run it will
6 /// set a new variable, and after that it will try to find it again.
7 /// The random number is just to prevent browser caching.
11 if (!isset($_SESSION["test"])) { // First time you call it.
12 echo "<p>No session found - starting a session now.";
13 $_SESSION["test"] = "welcome back!";
15 } else { // Subsequent times you call it
16 echo "<p>Session found - ".$_SESSION["test"];
17 echo "</p><p>Sessions are working correctly</p>";
20 echo "<p><a href=\"session-test.php?random=".rand(1,10000)."\">Reload this page</a></p>";