title: redirecting to paypal's approval_url via javascript
body: <p>I need to use javascript to redirect to paypal's approval_url</p>
  
  <p>if I do </p>
  
  <pre><code>window.location = "&lt;%= approval_url %&gt;";
  </code></pre>
  
  <p>I am getting to a page that says </p>
  
  <pre><code>This transaction is invalid. Please return to the recipient's website to complete your transaction using their regular checkout flow.
  </code></pre>
  
  <p>and the url is </p>
  
  <pre><code>https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_flow&amp;SESSION=xJniP0ittD1dtW_QGQXqLx91Byimw8A3ZvU71TCcY6Ktm-hyIhp2dpF7SoboFa&amp;dispatch=50a222a57ty771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9b61f737ba21b081982546798d23b9808f2b0faaf533a5dbe5
  </code></pre>
  
  <p>However, if I manually take the approval_url and paste it in the browser it reaches the page successfully.</p>
  
  <p>What is the difference here? </p>