title: session not working as expected with mobile devices
body: <p>Hi,</p>
  
  <p>I have a site with 2 versions, one for the PC and one for the mobile. PC version goes like this mysite.org whereas mobile version goes mysite.org/mobile
  So when a user visits the site from a mobile device it is automatically redirected to mysite.org/mobile through JS code. That works fine, however, I am offering my users the choice to see the PC version instead so I need a way to tell the browser to stop redirecting once the PC version button is pressed. This is what I did.</p>
  
  <pre><code>&lt;?php
  session_start();
  $_SESSION['redirect'] = true;
  
  # Check whether the session should be unset.
  if ($_GET['no_redirect'] == "true") {
     unset($_SESSION['redirect']);
  }
  
  # Check whether the session is set.
  if (isset($_SESSION['redirect'])) {
   $redirect = &lt;&lt;&lt;EOF
  &lt;script type='text/javascript'&gt;DM_redirect("mobile/$page");&lt;/script&gt;
  EOF;
  }
  ?&gt;
  </code></pre>
  
  <p>my html code goes like this</p>
  
  <pre><code>&lt;script type='text/javascript' src='js/mobile.js'&gt;&lt;/script&gt;
    $redirect
  </code></pre>
  
  <p>if the $redirect variable is empty, redirection will not occur no matter what device is being used. The variable wont be empty as long as $_SESSION['redirect'] is true. So my button to stop redirecting and see the PC version looks like this:</p>
  
  <pre><code>&lt;a href="&amp;no_redirect=false" rel="alternate"&gt;SEE PC VERSION&lt;/a&gt;
  </code></pre>
  
  <p>whereas the button to go back to the mobile version looks like this</p>
  
  <pre><code>&lt;a href="&amp;no_redirect=true" rel="alternate"&gt;SEE MOBILE VERSION&lt;/a&gt;
  </code></pre>
  
  <p>it wont quite work because after pressing the PC version button it goes indeed to the PC version page but if I navigate from there it redirects again to the mobile version. What solution can I use?</p>
  
  <p>Thank you.</p>