title: Unable to Store Session Variable On Form Submit
body: <p>When I try to submit my form a to form b and load it to a new page using javascript window.open or alternatively the action="" attribute on the form tag itself, everything fires off correctly but on the new page load the SESSION variables are NOT passed. However if i take away the window.open method, submit the form and mannually load the new page in my browser, the SESSION variables do come up correctly in the input fields on the new page in form b...</p>
  
  <p>I wondered if it had anything to do with the "return false;" part of the onsubmit function I have running on form a or if, on form submit and new page load, it's not setting the SESSION values before the SESSION stores them and loads the new page into the window... It has to be one of those two culprits. IT works if I don't do a page redirect, so I believe it's not actually storing the SESSION variables when the new page is loaded after submit... How can I correctly and successfully store the SESSION on the new page load so it loads correctly in the new page on form b?</p>
  
  <p>INDEX FILE (FORM A)</p>
  
  <pre><code>&lt;?php
  session_start();
  if(isset($_POST['submit'])) {
      $_SESSION['cable_no'] = $_POST['cable_no'];
      $_SESSION['co_name'] = $_POST['co_name'];
      $_SESSION['prepping_team'] = $_POST['prepping_team'];
      $_SESSION['section_no'] = $_POST['section_no'];
      $_SESSION['tech_name_a'] = $_POST['tech_name_a'];
  }
  ?&gt;
  &lt;header&gt;
  &lt;script type="text/javascript" language="javascript" src="/jquery/js/jquery-1.9.1.js"&gt;       &lt;/script&gt;
  &lt;script type="text/javascript" language="javascript" src="js/scripts.js"&gt;&lt;/script&gt;
  &lt;link href="css/style.css" type="text/css" rel="stylesheet" /&gt;
  &lt;/header&gt;
  &lt;form method="post" onsubmit="uploaddata(); return false;"&gt;
  HTML CODE
  &lt;input type="submit" id="submit" name="submit" value="Continue" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>JS FILE</p>
  
  <pre><code>function uploaddata() { 
  
  //Read all of the data from the page
  for (eID in prepform) {
      prepform[eID] = document.getElementById(eID).value;
  }
  //Send to database upload function and verify IF checkboxes are checked
  if(document.getElementById("a11").checked &amp;&amp; document.getElementById("b11").checked &amp;&amp; document.getElementById("c11").checked &amp;&amp; document.getElementById("a12").checked &amp;&amp; document.getElementById("b12").checked &amp;&amp; document.getElementById("c12").checked) {
          upload_prepform();
      }else{
          alert("Please verify that you have checked the known check boxes.")
      }
  }   
  function upload_prepform() {
      $.ajax({
              type: 'POST',
              url: './php/upload_prepform.php',
              data: prepform,
              async: false,
              dataType: 'text',
              success: function() {
                  alert("Thank you. Your Prep form has been submitted.");
              },
  
              error: function(jqXHR, textStatus, errorThrown) {
                      alert("Error... " + textStatus + "\n" + errorThrown);
              },
              complete: function() {
                  window.location.replace("http://dev1.rs.idmyasset.com/gp21-dev/prep_b/");
                  alert("Redirecting...");
              }
          });
      };
  </code></pre>