session variables
- From: sheldonlg <sheldonlg>
- Date: Mon, 30 Jun 2008 17:03:00 -0400
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?
.
- Prev by Date: Re: help with recusion in DOM
- Previous by thread: stream_socket_client and /etc/hosts file
- Index(es):
Relevant Pages
|