I'm having problem with a session variable changing when a user moves from the unsecure server to the secure server. I have the following code which registers each user with a unique 11 digit number:
// refcode
session_register('refcode');
if(empty($refcode) || strlen($refcode) != "11") {
$allow = "123456789";
srand((double)microtime()*1000000);
for($i=0; $i<11; $i++) {
$refcode .= $allow[rand()%strlen($allow)];
}
} else {
$refcode = $refcode;
}
This number isn't changing on the normal unsecure server. However, when a user hops onto a secure page, this number is changed to something totally different. I'm having difficulty trying to figure it out. I've checked the apache virtual hosts that I created and both of them are saving the session variables in the correct location.
Thanks in advance for any help.
ADDING TO THIS POST:
I have found something interesting. Even though I have set the session_save_handler in the configuration file for the secure server, php info is still showing the session save path on the secure server as:
session.save_path /tmp /tmp
However, phpinfo is showing the save path on the unsecure server as:
session.save_path /home/batorgtmp /tmp
ADDING AGAIN:
I found the error. In my virtual host for the secure server I had the directive set to:
php_value session_save_path "/home/batorgtmp"
session_save_path should be session.save_path
Thanks for any help and your time in reading this.