Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session variable getting registered twice

Status
Not open for further replies.

mpopnoe

Programmer
Feb 28, 2002
47
US
I'm registering a variable on my login page and redirecting the browser to a new page. On that new page I placed session_start() before any HTML. I then check the value of my session variable and the value I set is gone. When I check the temp folder to look at the session files, two files were created, the first one has the value in it and the second is blank. Why are two files being created? Is there possible something I need to change in the INI file?

Here is a snippet of what I'm trying to do:

(login.php)

<?php

//SET THE VALUES FOR TESTING PURPOSES
session_start();

if (! isset($loggin)) {
session_register(&quot;loggin&quot;);
$loggin = true;

?><script>
location.replace('page2.php');
</script>

<?php
}

?>

//%%%%%%%%%%%%%%%%%%%%%%%%

(page2.php)

<?php
session_start();
echo &quot;The value is: &quot; . $loggin;

?>

Any help would be great! Thanks!
 
I am having a very similar problem and would like to hear how this one gets resolved, please if anyone can help that
'd be great!!!

thanks
Joe
 
Thanks for all you help, I finally got it working. I needed to append the SID to the url eventhough I have trans_id set in the INI file. I had tried this before but used PHPSESSID instead of SID so it didn't work and instead of troubleshooting it I moved on.

thanks again :)

mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top