title: Trying to save username / password in cookie ; JQuery
body: <p>I saw this example about storing login information in cookie. </p>
  
  <p><a href="http://eisabainyo.net/weblog/2009/02/20/store-login-information-in-cookie-using-jquery/" rel="noreferrer">http://eisabainyo.net/weblog/2009/02/20/store-login-information-in-cookie-using-jquery/</a></p>
  
  <p>Tried it, but can't seem to get it to work. I have to plugin and I don't see what's wrong here. </p>
  
  <p>This page is Login.aspx which points to AccountMenu.aspx</p>
  
  <p><strong>EDIT</strong> IT'S FOR A DEMO, TEST, WHATEVER YOU WANNA CALL IT. this site will never go online. I KNOW this is not the way to do it. I'm looking for help to solve my problem, not people telling me this is bad design.</p>
  
  <p>(...)</p>
  
  <p></p>
  
  <pre><code>    &lt;div data-role="content"&gt;
  
      &lt;form action="AccountMenu.aspx" method="post" id="login"&gt;
  
          &lt;label for="email"&gt;Email&lt;/label&gt;
          &lt;input type="text" id="email" name="email"/&gt;
  
          &lt;label for="password"&gt;&lt;%= GetLabel("password") %&gt;&lt;/label&gt;
          &lt;input id="password" type="password" name="password" /&gt;
  
          &lt;div data-role="fieldcontain"&gt;
          &lt;fieldset data-role="controlgroup"&gt;
              &lt;input type="checkbox" name="remember" id="remember" class="custom" checked="true" /&gt;
              &lt;label for="remember"&gt;Remember me ?&lt;/label&gt;
          &lt;/fieldset&gt;
          &lt;/div&gt;
  
          &lt;input type="hidden" name="submit" value="submitted" /&gt;
          &lt;button type="submit" name="submit" id="submit" data-theme="a"  value="&lt;%= GetLabel("new-login") %&gt;" &gt;&lt;/button&gt;
          &lt;button type="button" disabled="disabled" data-theme="a" value="&lt;%= GetLabel("new-account") %&gt;"&gt;&lt;/button&gt;        
  
      &lt;/div&gt;
  
   &lt;/form&gt;
  
      &lt;script type="text/javascript"&gt;
  
          if ($('#remember').attr('checked')) 
          {
              var email = $('#email').attr("value");
              var password = $('#password').attr("value");
  
              // set cookies to expire in 14 days
              $.cookie('email', email, { expires: 14 });
              $.cookie('password', password, { expires: 14 });
              $.cookie('remember', true, { expires: 14 });                
          }
          else
          {
              // reset cookies
              $.cookie('email', null);
              $.cookie('password', null);
              $.cookie('remember', null);
          }
  
          var remember = $.cookie('remember');
          if (remember == 'true') 
          {
              var email = $.cookie('email');
              var password = $.cookie('password');
              // autofill the fields
              $('#email').attr("value", email);
              $('#password').attr("value", password);
          }
  
      &lt;/script&gt;    
  </code></pre>
  
  <p></p>