Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to redirect to a different page when a browser's Back button click

Status
Not open for further replies.

sheed

Programmer
Jun 14, 2005
38
US
I have a web JSP/Servlet web app where a user logs-in and search on the data, while searching data. if user presses back button on Internet explorer window "webpage expires !" pops-up but when user refreshes the page it reloads again. Instead if the refresh is clicked I want to end the users session take it to the login page. Also if the user comes on the login page and at that point if pressing forward button I want to keep on the login page until the user explicitly logs-in again. Any help is appreciated. Thanks
 
In general this issue is resolved with "POST THEN REDIRECT" technique. You should not generate a page right on POST, but rather redirect to the result page.

Regards, Dima
 
I am doing post and then reiderect on my login page. But if a user comes to log-in page pressing back button I don't want to end the session and let the user log log-in again rather than just pressing the forward button to navigate the pages. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top