note 37267 deleted from function.session-is-registered by betz
| From: | betz@php.net | Date: | Fri, 08 Jul 2005 17:31:13 +0000 |
| Subject: | note 37267 deleted from function.session-is-registered by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-91692@lists.php.net to get a copy of this message | ||
Note Submitter: sorr at see ess you ell bee dot edu
----
The previous comment is bad code. Don't copy it.
Here is a better code block. Copy this.
===================================
<?php
// Start session and set variable.
session_start();
$_SESSION['theSESSIONvarName'] = "is_set";
// Check if the session is set.
if(isset($_SESSION['theSESSIONvarName']))
{
$sid = session_id();
echo "<html>";
echo "<head><title>PHP Session Is Set!</title></head>";
echo "<body><p>The session is set! The PHPSESSID is:
$sid</p></body>";
echo "</html>";
}
else
{
echo "<html>";
echo "<head><title>PHP Session Is NOT Set!</title></head>";
echo "<body><p>The session is NOT set! Check your server configuration or
version.</p></body>";
echo "</html>";
}
?>