title: Login using javascript in context of session id
body: <p>i have one website that generates a session id and opens another website in the context of this session id.i want one button to open the first site and than automaticaly login on the second site.</p>
  
  <p>site 1:<a href="http://thisisanexample/example" rel="nofollow noreferrer">http://thisisanexample/example</a> leads to <a href="http://thisisanotherexample/another" rel="nofollow noreferrer">http://thisisanotherexample/another</a></p>
  
  <p>this opens the the first site and the second site is opened afterwards:
      
      var myWindow;</p>
  
  <pre><code>function openWin() {
  myWindow = window.open("http://thisisanexample/example");
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>after here i'm stuck. How could i submit the following Post request to site 2</p>
  
  <pre><code>&lt;form action="http://thisisanotherexample/another/" method="POST" name="logonForm"&gt;
      &lt;input type="text" name="user" value="placeholder"&gt;
      &lt;input type="hidden" name="passwordnew1" value=""&gt;
      &lt;input type="hidden" name="passwordnew2" value=""&gt;
      &lt;input type="password" name="password" value="placeholder"&gt;
      &lt;input type="hidden" name="welcomescreen" value="1"&gt;
      &lt;input type="submit" value="Anmelden" name="cmd_login"&gt;
  </code></pre>
  
  <p>I hope you get what i mean :-)</p>