RE: [PHP] Re: Your script possibly relies on a session side-effec t which existed until PHP 4.2.3
| From: | Ford, Mike [LSS] | Date: | Thu, 13 Mar 2003 10:53:04 +0000 |
| Subject: | RE: [PHP] Re: Your script possibly relies on a session side-effec t which existed until PHP 4.2.3 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-139479@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: chris [mailto:spam@bittersweet2.com]
> Sent: 13 March 2003 00:24
> To: php-general@lists.php.net
>
> 1. Registered globals are off.
> 2. Using super globals ($_SESSION instead of $HTTP_SESSION_VARS)
> 3. Setting via $_SESSION['var'] = $var instead of
> session_register('var')
> 4. Always calling $_SESSION['var'] instead of $var
> (registered globals are
> off, so it really isn't an option, now is it?)
> 5. Unsetting via unset($_SESSION['var']) instead of
> session_unregister('var')
Well, all of that is exactly what you need to do to avoid the buggy behaviour. Are you using *any*
other session_*() calls apart from session_start()?
If not, and you are 101% certain that all your pages are coded in the style you've enumerated,
then your best bet is just to change the setting of one or both of the session.bug_compat_*
configure options. If you only turn bug_compat_warn off, you will suppress the warning whilst still
retaining the old behaviour (just in case!). But if you're sure you're not relying on the
buggy behaviour, why not just turn bug_compat_42 off? If you've got it right, your scripts
will still work; if not, then you should at least have some clues to help you find and fix the
erroneous code.
As to why you're still getting the warning, even though your session code appears to be safe, I
think there's a clue in the first few words of the message itself: "Your script possibly
relies ...". Note that "possibly". Why the changes you refer to should determine
whether or not the warning is evoked I have no idea, but something in there is triggering it.
Again, if you're sure that that "possibly" doesn't apply to you, just turn off
one or both of the configure options.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211