Transmitting the Correct Session Data when Multiple Tabs are Opened on a Web Browser
<p>I have a PHP script (<strong>script A</strong>) that makes a query to the database, stores the result in a session variable and produces a HTML page containing a form that allows the user to post a submission (<em>optionally</em>). Upon submission, the result stored in the session variable is used for processing in another script (<strong>script B</strong>).</p>

<p>As the HTML page is not unique, the user may open multiple tabs showing different pages generated by <strong>script A</strong>. Since the session variable can only hold data for the latest generated page, when the user clicks on any of the previous tabs and do a submission, the wrong set of session data will be used.</p>

<p>One way to preventing this from happening is to force the page to automatically reload before submission occurs. Is there any better and <strong>secure</strong> way to do this short of re-querying the database in <strong>script B</strong>?</p>
