Session Variables Wierdo

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Here is a nutty one:

I have session variables in my page.  Take two of them:
$_SESSION['currentID']   and    $_SESSION['firstName'].

Now $_SESSION['currentID'] is set before the page and  
$_SESSION['firstName'].is set on entry to the page.  The  
$_SESSION['firstName'].displays properly in the following html code, so I  
know it gets set.

When I click on a button named editFoo, I do a

if (!isset($_POST['editFoo']) {
    header{"Location: blah");

What happens is that the $_SESSION['currentID'] is still there but the  
$_SESSION['firstName'].is empty.

I checked the sending page by putting an echo before the if statement (which  
is the last before going into display the html and after the  
$_SESSION['firstName'].has been set.  Both variables display perfectly.  
When I click on the editFoo button, only the $_SESSION['currentID'] displays  
properly and the other displays empty.

I have @session_start() in all.

Any clues?


Re: Session Variables Wierdo

As ususal, or at least as so often happens, right after I am totally  
frustrated and post to the group, a lightbulb goes on and I solve the  

Why did this happen]?  Because I had a check if $_POST['currentID'] was set  
and if not, then I would clear all the OTHER session variables.  Pilot  
error.  All I had to do was think about how the currentID could be treated  
differently than the others.

Thanks anyway.

Quoted text here. Click to load it

Site Timeline