| | |
How to control back button in browser
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2009
Posts: 9
Reputation:
Solved Threads: 0
hi
I have a simple log in form.
I want that after user logs in , he should not be able to goto login page again using back button of browser.
Does page reloads fresh when back button is clicked or it simply displays what was earlier.
login.jsp
If user clicks back button of browser , alert("hi") is not executed.it means it simply display the last page.
How can i prevent this.
Thanx in advance
I have a simple log in form.
I want that after user logs in , he should not be able to goto login page again using back button of browser.
Does page reloads fresh when back button is clicked or it simply displays what was earlier.
login.jsp
JSP Syntax (Toggle Plain Text)
<% response.setHeader("Cache-Control","max-age=0"); response.setHeader("Pragma","no-cache"); response.setDateHeader("Expires", 0); //prevents caching at the proxy server %> <script type="text/javascript"> alert("hi"); </script> <HTML> <HEAD> </HEAD> <BODY> my page body <form action="validation.jsp"> <input type="submit"> </form> </BODY> </HTML>
If user clicks back button of browser , alert("hi") is not executed.it means it simply display the last page.
How can i prevent this.
Thanx in advance
Ehmm why to mess with cookies when you can use power of session?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
- disable back button in the browser using javascript (JavaScript / DHTML / AJAX)
- Disable 'Back' button on browser (ASP.NET)
- Back button in browser (ASP.NET)
- Textboxs not staying disabled after browser back button clicked (JavaScript / DHTML / AJAX)
- How to disable back button and backspace using Javascript..? (JavaScript / DHTML / AJAX)
Other Threads in the JSP Forum
- Previous Thread: jsp ms acess form
- Next Thread: Please how do i start using jsp to build web pages on netbeans
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web






