Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disabling session when clicking Back button and redirecting to Login page with message

 
Yugandhar Ghanta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not capture the fact that the back button on the client was clicked. You should t least disable caching on the client.
 
Yugandhar Ghanta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).

Thanks...
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 )

Please provide your thoughts ASAP...

Thanks,
Yugandhar.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yugandhar Ghanta wrote:

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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to insinuate that the onbeforeunload will be triggered only when the user pressed the back button.

You´re wrong.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yugandhar Ghanta wrote: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...


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.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bauke
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic