PHP Sessions - Getting recalculated only in Chrome

So, here’s my situation. This is only happening in Chrome 16.0.912.75.

I am trying to set a session variable like this:

$random_num_signupsignonform = rand(5, 151010101);
$_SESSION[‘random_num_HPPage’] = $random_num_signupsignonform . “2w3”;

So when the page loads, the session variable ‘random_num_HPPage’ is being set to 194883032w3

When I submit my form, the session variable is being reset to another random number of 23909242w3, at the start of the page.

When I get to the line where I set the variable again, it’s being set again to, correctly this time, to 29498292w3.

IT seems like the random number generator is being rerun a second time when the page is loaded. But this is only happening on Chrome.

Help??!

Well the code you are using is being told to reset the session variable every time the page loads so technically it is doing exactly what you are telling it to.

Sponsor our Newsletter | Privacy Policy | Terms of Service