title: Are passwords stored in memory safe?
body: <p>I tend to store users password in memory for later uses.</p>
  
  <pre><code>var credentials = {};
  function register(username,password){
      //when users click sign up
      credentials.username = username;
      creadentials.password = password;
  }
  function login(){
      //Users can click login at anytime. Or they just don't.
      ajax('/User/login',credentials).then(function(){
          credentials = {};
      });
  }
  </code></pre>
  
  <p>Should I worry about the security task with this approach? If this is a bad idea, how will attackers retrieve the password?</p>