session variables



I have come across this problem before but never really resolved it. It is probably something so obvious that I should be embarrassed to even ask in this forum.

The problem is one of losing the value of a session variable. Here is a sample of what I mean:

FileA.php:
Form to send to credit card processing firm. Prior to this, a session variable for "security" had been defined as a blank space. This file's action goes to a secure server where another page is presented. The return goes to FileB.php.

FileB.php:
session_start();
// Return from cc firm.
// Do stuff to insert into our db
$_SESSION['user'] = $username;
// var_dump($_SESSION);
header("Location: http://www.mydomain.com/FileC.php";);
exit();

FileC.php:
session_start();
var_dump($_SESSION);
exit();

When I uncomment the var_dump in FileB.php, it shows the value for the session variable for user, but not for security. However, commenting it out again and proceeding on the FileC.php, the session variable value for user is lost but it has the value that for "security" that had been set earlier in the entire process.

Specifically, in

FileB.php: array(1) { ["user"]=> string(6) "shelly" }

but in

FileC.php: array(1) { ["security"]=> &string(1) " " }

It is almost as if it is switching from one session to another. Any ideas?
.



Relevant Pages

  • Re: session variables
    ... The problem is one of losing the value of a session variable. ... Form to send to credit card processing firm. ... When I uncomment the var_dump in FileB.php, it shows the value for the session variable for user, but not for security. ...
    (comp.lang.php)
  • Re: session variables
    ... The problem is one of losing the value of a session variable. ... Form to send to credit card processing firm. ... When I uncomment the var_dump in FileB.php, it shows the value for the session variable for user, but not for security. ...
    (comp.lang.php)
  • Re: session variables
    ... The problem is one of losing the value of a session variable. ... Form to send to credit card processing firm. ... When I uncomment the var_dump in FileB.php, it shows the value for the session variable for user, but not for security. ...
    (comp.lang.php)
  • Re: session variables
    ... Form to send to credit card processing firm. ... you can just employee JavaScript to redirect the page. ... That is why the header information to change the page is there. ...
    (comp.lang.php)
  • Re: small secure POP3 servers?
    ... I know that qpopper is easy to setup, dont know about its security ... tho. ... basically you make install and uncomment a statement in inetd.conf ...
    (comp.security.unix)