Re: Help Needed: Sessions

From: Date: Tue, 15 Aug 2000 22:21:22 +0000
Subject: Re: Help Needed: Sessions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-11881@lists.php.net to get a copy of this message
Ben Meyer wrote: > > > > session_start(); > > > session_name("my_session_name"); > > > session_register($UserData); > > > $UserData["SessionID"] = session_id(); > > > $UserData["SessionName"] = session_name(); > > > PHP_SESSION_RECORD("LOGON"); //This is the function that I use to record > > the > > > information to the database. > > > > > > Now my problem comes in in that the $UserData is not being saved. I > > cannot > > > access the information stored in $UserData[] on other pages of the > > session. > > > It is not unregistered until the user goes to the Logout page. > > Please correct the line: > > > > session_register($UserData); > > > > into: > > > > session_register("UserData"); > > > > and it should work .... > > > Thanks of the advice. I tried it but it has not changed anything. The login > page creates the session, registers and initializes the variable, writes the > entry to a MySQL database, then forwards to the index page. While the data > is good at the login page, I have had a tester on the index page for a while > to print out the value of one of the array parts on load which still reads > as being empty. Moreover, my check function (b/c I want to send them to > login if the session id is invalid or non-existant) keeps sending me to the > login page. What I think the problem may be is that I am running Php > 4.0.1pl2 and the symptoms of the session bug with that version seem to be > the same, so it may not even be writing the variable to the session file > back in the login stage. Does this sound right to anyone else? > > When does it look like Php 4.0.2 is going to be released? > If anyone has any other suggestions as to how to fix it, please let me know. > I have only about 4 days to fix the site and really need to get it > completed. > > Thank you, > > Benjamen R. Meyer First at all you have to do the session_start()/session_register() on every page (I do it in an include-file). Second, I also use 4.0.1pl2 and it works. cu Martin -- -------------- Martin Neimeier Tel:+49(6262)912344 Fax:+49(6262)912347

« previous php.general (#11881) next »