title: Back button disable issues in javascript
body: <blockquote>
  <p><strong>Possible Duplicate:</strong><br />
  <a href="https://stackoverflow.com/questions/961188/disable-browsers-back-button">Disable browser's back button</a><br />
  <a href="https://stackoverflow.com/questions/4194207/prevent-user-from-going-back-to-the-previous-secured-page-after-logout">Prevent user from going back to the previous secured page after logout</a></p>
  </blockquote>
  
  <p>I am developing an online course registration portal in which after successfully login the user redirects to his home page. In his home page there is a hyperlink for logout which when the user clicks directs to a servlet which invalidate the session and redirects to the portal home page. In the portal home page i am using the following script in the head section of the html code:</p>
  <pre><code>&lt;script&gt;
      window.history.forward(1);
  &lt;/script&gt;
  </code></pre>
  <p>In the body section of the html code I am using this.</p>
  <pre><code>&lt;body onunload=&quot;javascript:history.go(1)&quot;&gt;
  </code></pre>
  <p>But the problem is that still the back button redirects me to the user home page after logout. But after that when I click the back button it remains on the user home page. But i want to restrict it to the portal home page.</p>