title: URL variable to Session variable (using GET method)
body: <p>I am trying to store a value obtained from a URL variable into a SESSION variable. </p>
  
  <p>Here is the URL:</p>
  
  <pre><code>&lt;a href="webpage.php?store=&lt;?php echo 'Ace'; ?&gt;"&gt;Ace Hardware&lt;/a&gt;
  </code></pre>
  
  <p>Here is the SESSION coding, which retrieves the variable, but loses the variable value upon leaving the page.</p>
  
  <pre><code>$_SESSION["store"] = $_GET["store"];
  $shopByStore = $_SESSION["store"];
  </code></pre>
  
  <p>If I plug in the value in quotes as it is below (see "Ace" in code below), it works. But it doesn't work in the code above using the GET method ($_GET["store"])</p>
  
  <pre><code>$_SESSION["store"] = "Ace";
  $shopByStore = $_SESSION["store"];
  </code></pre>