Posted by Toby A Inkster on 05/02/07 11:35
K. A. wrote:
> Step 2. A page called login.php that takes the posted username, stores
> it as $_SESSION["username"], and registers it
> session_register("username"); user is taken to the personalized page
> according to his username and things are fine up to here. (this page
> is not displayed, only for redirecting purposes).
session_register() is old-style register_globals-type code. Remove it.
> Next, I did exactly the same steps on server B; at step 2 (above) user
> is directed to the correct page. But when I get to step 3, the session
> seems to lose or set all its variables to NULL (I checked this using
> var_dump($_SESSION)).
You remembered session_start()? You need to call that before trying to
access $_SESSION.
--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
Now Playing ~ ./vol/music/lisa_germano_-_wood_floors.ogg
[Back to original message]
|