note 59941 deleted from function.session-register by philip
| From: | philip@php.net | Date: | Wed, 29 Mar 2006 06:27:58 +0000 |
| Subject: | note 59941 deleted from function.session-register by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106922@lists.php.net to get a copy of this message | ||
Note Submitter: webmaster AT thedemosite.co.uk
----
It states above that there is no need to set $HTTP_SESSION_VARS or to use session_register if you
are using >PHP4.1x but this is NOT the case! [dependant upon your system]
Using PHP5 you can set a session variable like this:
if(!session_id()) session_start();
$_SESSION['your_id']=$your_id;
BUT, with PHP4 you need to use (also fine for PHP5):
if(!session_id()) session_start();
session_register("your_id");//used for older versions of PHP
$HTTP_SESSION_VARS['your_id']=$your_id;//used for older versions of PHP
$_SESSION['your_id']=$your_id;
//tested on PHP4 on Linux, FreeBSD and Windows.
So if you are updating your scripts ready for use with PHP5 but still running on version 4 then use
the later method.