Altered States
I have a site where a user will complete a sequence of pages/forms and return to the beginning. Something like:
Page A -> Page B -> Form C -> Submit and return to Page A
Page D -> Page E -> Form C -> Submit and return to Page D
There are multiple routes (approx. 6) to get to Form C. ETA: Depending on where they start, there are different prerequisites.
I use a session variable that gets stored at either Page A or Page D. When the user submits Form C, the session variable is checked and they are sent back to the page they started at.
There is a problem that crops up when they open multiple browser windows or tabs. Let's say they navigated to Form C from page A and decide they want to check some data on Page D before submitting. They open a new tab and go to Page D, which tells the session variable to return to Page D when they get to Form C. When they switch back to the first tab and complete Form C, the session variable was corrupted by the other tab and they return to Page D instead of Page A.
The browser uses the same cookie for the new tab/window and therefore php will use the same session variables.
Any suggestions on how best to solve this problem? Is there something I am totally overlooking?
I've thought about propagating a window ID or something in the URL, or perhaps setting a variable in the browser using javascript.
Page A -> Page B -> Form C -> Submit and return to Page A
Page D -> Page E -> Form C -> Submit and return to Page D
There are multiple routes (approx. 6) to get to Form C. ETA: Depending on where they start, there are different prerequisites.
I use a session variable that gets stored at either Page A or Page D. When the user submits Form C, the session variable is checked and they are sent back to the page they started at.
There is a problem that crops up when they open multiple browser windows or tabs. Let's say they navigated to Form C from page A and decide they want to check some data on Page D before submitting. They open a new tab and go to Page D, which tells the session variable to return to Page D when they get to Form C. When they switch back to the first tab and complete Form C, the session variable was corrupted by the other tab and they return to Page D instead of Page A.
The browser uses the same cookie for the new tab/window and therefore php will use the same session variables.
Any suggestions on how best to solve this problem? Is there something I am totally overlooking?
I've thought about propagating a window ID or something in the URL, or perhaps setting a variable in the browser using javascript.
