Page 1 of 1

session_unregister

Posted: Wed Jan 26, 2005 6:30 am
by mcog_esteban
hi...can someone explain me why i see this on the php manual:

If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered() and session_unregister().

there's several cautions in the sessions manuals.
thanks.

Posted: Wed Jan 26, 2005 8:55 am
by patrikG
moved to PHP Code.

Posted: Wed Jan 26, 2005 10:16 am
by wwwapu
http://fi.php.net/manual/fi/function.se ... gister.php
In the manual:
If you want your script to work regardless of register_globals, you need to instead use the $_SESSION array as $_SESSION entries are automatically registered. If your script uses session_register(), it will not work in environments where the PHP directive register_globals is disabled.
So if you want your script to be portable you should use $_SESSION. session_register &co. seem to be rather oldish ways of doing stuff.