RE: [PHP] session HELL !!!!!!

From: Date: Mon, 16 Oct 2000 03:57:32 +0000
Subject: RE: [PHP] session HELL !!!!!!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-20296@lists.php.net to get a copy of this message
hmmm interesting thought, so... I am on a test environment at the moment, so I cleaned out '/tmp' and then logged as the only user.. it created a session with just login data. So far so good user enters data and hits submit.. in the session in /tmp/xxx, all the data is stored correctly (and there is still only one session) user chooses to enter another record, the new record entry into the database is correct, BUT, the session data has not changed??? I looked at the 'last modified' timestamp on the session, and it changed with the submit of the form... but no data was changed.. aaaggghhhh !!!!! I even removed the session_register lines and just left the $contactID as updated. the session record was 'touched' but not changed ... richard (in hell still ;-)) -----Original Message----- From: Szii [mailto:szii@sziisoft.com] Sent: Sunday, October 15, 2000 8:17 PM To: richard Subject: Re: [PHP] session HELL !!!!!! Doesn't look like you're doing anything WRONG, but since you register the name, why not just change it? The value will follow. ie, $contactID = "42"; session_register("contactID"); $contactID = "43"; The variable's already reg'd for "persistance" so you don't have to unreg/re-reg it. As for it not being "saved" correctly in the session data, are you sure you're reusing the same session? Have you looked at your server-side file (ie, /tmp/xxx) to verify that it is indeed wrong? You may be setting it, but without the same session (or a valid session) having been started, you're just going to end up with legacy artifacts. -Szii At 08:23 PM 10/15/00 -0700, you wrote: > >hi folks, here's the scenario, > >user fills in a form to add a record to a database. record is created and >uses mySQL autoincrement to create the record ID. I then use the PHP >function mysql_insert_id() to return the ID of the created record. I then >use session_register to write the value of this created record ID into the >session registry for this user. >At this point, the user may choose to work further on the created record, >(accessing the data through the ID in the session), or create a second new >record. >In the later case (creating a new record) I do a "SESSION_UNREGISTER" of the >ID and use "SESSION_REGISTER" to write in the new value once this has been >determined by the script. > >however, the session only remembers the old value.???????????????? > >here is a chunk of hte code, at this point it assumes a valid entry and good >result insertion into hte mysql database > >session_unregister("contactID"); >$contactID = mysql_insert_id(); >session_register("contactID"); > >but this doesnt work... > >the value of $contactID is correct in the script, but in the session data >the contactID is the same as the last time round... > >what am I doing wrong ?????????????????????????? > >richard > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#20296) next »