Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If I understand correctly, your app has two modes. Let's call them red and blue. User opens window 1 and selects red. User then opens window 2 and selects blue. If you merely used sessions, then if the user goes back to window 1 and clicks anything, the result would be blue because the previous click was blue, even though window 1 is red.</p> <p>I suggest using mod_rewrite (or an equivalent on non-Apache servers) to modify the URL to indicate the mode.</p> <p>Incoming request for </p> <pre><code>example.com/red/yourscript ==&gt; example.com/yourscript?mode=red example.com/blue/yourscript ==&gt; example.com/yourscript?mode=blue </code></pre> <p>If all the links and forms on your page are relative and not absolute, the URLs should have the mode info in them.</p> <p>That is, if the page URL is</p> <pre><code>example.com/red/yourscript </code></pre> <p>then links on the page that look like this</p> <pre><code>&lt;form action="anotherscript"&gt; </code></pre> <p>will have a URL of</p> <pre><code>example.com/red/anotherscript </code></pre> <p>Another way would be to use subdomains</p> <pre><code>red.example.com/yourscript ==&gt; example.com/yourscript blue.example.com/yourscript ==&gt; example.com/yourscript </code></pre> <p>You would not need mod_rewrite if you configure your server to serve both subdomains from the same real location.</p> <p>Using the subdomains would allow you to extract the mode from the http_referer field of each incoming request and you wouldn't need to add the query string. </p> <p>Lastly, add absolute links to explicitly change the mode.</p> <pre><code>&lt;a href="http://example.com/red/changemode"&gt;Click here to go to RED mode&lt;/a&gt; &lt;a href="http://example.com/blue/changemode"&gt;Click here to go to BLUE mode&lt;/a&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload