This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Disabling session when clicking Back button and redirecting to Login page with message
Yugandhar Ghanta
Greenhorn
Joined: Jan 12, 2009
Posts: 6
posted
0
Hi friends,
How to disable session in web application whenever user click on back button of browser and also need to redirect him to some error page...
Thanks in advance,
Yugandhar...
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
posted
0
You can not capture the fact that the back button on the client was clicked. You should t least disable caching on the client.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Yugandhar Ghanta
Greenhorn
Joined: Jan 12, 2009
Posts: 6
posted
0
Hi Bosun Bello ,
Thanks for your reply, i thought same on this...But, in some sites(e.g. bank sites) i found clicking back button is redirecting to Some Error page. I need to implement same in my current project. Present, we are disabling back button functionality by using Java script. But, we need to implement it as disabling session and redirect user to error page(with some message and login page link).
Yugandhar Ghanta wrote:
How to disable session in web application whenever user click on back button of browser
if you invalidate the session then you click browser back button . do you think the same session become active ?
Yugandhar Ghanta
Greenhorn
Joined: Jan 12, 2009
Posts: 6
posted
0
Hi All,
Here, i need to invalidate session whenever user clicks on Back button in any page of web application...
(not like, clicking Back bnutton after invalidating session )
Here, i need to invalidate session whenever user clicks on Back button in any page of web application...
i am not sure . but whenever user click the back button , we can track the behaviour (it is nott 100% )through below javascript code . inside the javascript function you need to call java method which wiill invalid user session
javascript code:
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
You seem to insinuate that the onbeforeunload will be triggered only when the user pressed the back button.
How to disable session in web application whenever user click on back button of browser and also need to redirect him to some error page...
Thanks in advance,
Yugandhar...
You´re looking for a solution in the wrong direction.
Right solutions involve under each disabling the response caching, the POST-Redirect-GET pattern and/or a solid authentication filter.