Re: Re: Problem with sessions.(Again Sorry :)
| From: | Richard Lynch | Date: | Sun, 21 Jul 2002 19:48:08 +0000 |
| Subject: | Re: Re: Problem with sessions.(Again Sorry :) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108747@lists.php.net to get a copy of this message | ||
>> Don't cram things into $_SESSION. Use this:
>>
>> session_register('uid');
>> global $uid;
>> $uid = $uinfo[0];
>
>With PHP 4.2, you don't have to use session_register. You can do it
>exactly like the OP is. I do it all the time. Whether that is a
>"feature" or a bug, I don't know.
It happens to work because that happens to be how Sessions are implemented
this week.
Programming 101:
Rule #27: Relying on implementation minutia instead of documented functions
is just a Bad Idea (tm).
Use the functions that are documented to work. Anything else is a HACK and
subject to break without notice.
In PHP 4.3 or 5.0 or 7.3.1, when it *DOESN'T* work anymore and you have a
zillion lines of code cramming junk into $_SESSION scattered all through
your application, don't come crying to me. :-)
--
Like Music? http://l-i-e.com/artists.htm