title: find email and userID in cookie with javascript
body: <p>I am storing a cookie on one page, with inputs in a form with this function:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function WriteCookie()
  {
     emailValue = escape(document.form.01_email.value) + ";";
     userIDValue = escape(document.form.01_userID.value) + ";";
  
     document.cookie="email=" + emailValue;
     document.cookie="userID=" + userIDValue;
  }
  &lt;/script&gt;
  
  &lt;form name="form"&gt;
   &lt;input type="email" class="form-textbox validate[required, Email]" id="input_10" name="01_email" size="26" value="email@email.com" /&gt;
   &lt;input type="hidden" id="simple_spc" name="01_userId" value="1234" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I get redirect to another page once a user submits the form, and I retrieve the cookie with this code but i need to have it find the email and userID in the cookie and insert it in the value of the inputs on this new page:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function ReadCookie()
      {
         var allcookies = document.cookie;
         alert("All Cookies : " + allcookies );
  
         // Get all the cookies pairs in an array
         cookiearray  = allcookies.split(';');
  
         // Now take key value pair out of this array
         for(var i=0; i&lt;cookiearray.length; i++){
            name = cookiearray[i].split('=')[1];
            value = cookiearray[i].split('=')[2];
            alert("Email is : " + name + " and UserID is : " + value);
         }
      }
      &lt;/script&gt;
  
  
      &lt;form name="form"&gt;
       &lt;input type="email" class="form-textbox" id="input_10" name="02_email" size="26" value="" /&gt;
       &lt;input type="hidden" id="simple_spc" name="02_userId" value="" /&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>I know a user will most likely have multiple cookies, so finding only the email and userID i'm having trouble with. </p>