note 46763 deleted from function.session-register by sean
| From: | sean@php.net | Date: | Sat, 23 Oct 2004 02:41:20 +0000 |
| Subject: | note 46763 deleted from function.session-register by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78968@lists.php.net to get a copy of this message | ||
Note Submitter: hs at byteconcepts dot de
----
To ensure that session registering works, you shouldn't use the example with $user_is_logged
because this only works with register globals on!
To check if registering of session variables is working register the session-id and then check if it
is registered:
8<--------8<--------8<--------8<--------8<--------8<--------8<--------
# Start a session if it hasn't been started before:
if ( ! session_is_registered('sessionID') ) {
session_start();
$_SESSION['sessionID'] = session_id();
}
# And here comes the check:
if ( ! session_is_registered('sessionID') ) {
die("ERROR: Session variables couldn't be initialised!\n");
}
8<--------8<--------8<--------8<--------8<--------8<--------8<--------
----
Reason: useless note