Page 1 of 1

Question about Warning in the PHP Manual

Posted: Thu May 22, 2003 3:12 pm
by Galt
The PHP manual says:

Code: Select all

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

Anybody know why we shouldn't do that? It works just fine (had to change it once I read the warning though), and I'm not sure why they don't want it used that way.

Posted: Fri May 23, 2003 2:24 am
by twigletmac
session_register() only works with register_globals on and is thus deprecated along with register_globals. You shouldn't have to use either it or session_is_registered() etc. any more as $_SESSION and isset() do the job better.

To answer the specific question though - generally $_SESSION and the old session functions don't play nicely together and normally if you use both the sessions won't work.

Mac