Session problem, disappearing variables...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Session problem, disappearing variables...

Post by nielsene »

I'm having one of those "tearing your hair out" little session bugs and was hoping that somebody here might have a clue.

Its a series of self-submitting pages, forwarding to the next step if everything checks out.

My user management system sets two session variables, security_hash and security_username. These two variables always survive, all other session variables seem to be problematic.

Variables set on page 1 of this multi-page "wizard" appear on page 2 as expected. Page two loses the variables both on successful submission and on unsuccessful submission. On successful submission the other 4 newly assigned session variables are lost as well.

register_globals is OFF.

The Session cookie is getting set properly on all pages.

I'm assigning to, and reading from, the superglobals.

The sessions are started in my common headers, before the security_hash& security_username are set which is all before the regular page operations happen. All other areas of the site behave.

As a further tesst, at the top of page 2 (on first arrival), print_r shows the correct variables. I read them from the superglobal into local variables and reassign back to the superglobals. The variabbles are lost on either reload or page submission.

OS: Mac OS 10.4.1
PHP: 4.3.11 (entropy.ch package)
Webserver: Apache 1.3.33 (Default with Mac OS X)
Running off localhost loopback.
Error reporting, On and E_ALL


Any ides why some session variables are getting lost? I know I've seen this before, but can't figure out what's going on....
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Are you storing objects in the session variables?
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

No, text strings and arrays of strings
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Is /tmp ,where the session-data is being written to, writable and is there enough space on the harddisk?
Post Reply