Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding log-out

 
Tusshar Fasate
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I facing problem regarding sign-out.
when i sign out from my application and click back button its again going to back page
which should not happen.
I invalidated the session also in log-out jsp .

I can not disable back button(using JS) as it will disable back button in my whole application.

Please suggest me the way to solve this problem.
thanks.
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a common problem. You will need to disable cache from the browser. I suppose you are not able to do any action after you press the back button as the session is invalidated and I hope that in your code you've appropriate checks to validate the user's session. So assuming that, you just need to stop the browser from storing your page in cached. Searching in the forum or google would give you good results. This is one of my search in the forum...
 
Tusshar Fasate
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ankit for your reply.
You are right .After back ,i am not able to do any thing.I am getting null pointer exception.
But how to disable cache from broser ?
Is there any specific code for that?
If you have any idea please guide me.thanks once again.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tushartrue fasate wrote:
But how to disable cache from broser ?

Have you looked at the search link the Ankit pointed ?
 
Tusshar Fasate
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I searched and i got various results on this topic .I pasted following stuff into my JSP

<%
response.setHeader("Pragma","no-cache");
response.setHeader("Cache-Control","no-store");
response.setHeader("Expires","0");
response.setDateHeader("Expires",-1);
%>


but still the problem is not resolved.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try putting this code in a page displayed after you click 'Log Out' action.
 
Tusshar Fasate
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I pasted it in log-out jps.
I am having mainMenu.jps and logOut.jps.
mainMenu jsp is having log-out hyperlink.
I tried it in both the JSPs ..but problem is there.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, the scriptlet code works for single request/response cycle, thus not caching only that page into browser memory.

I suggest using JavaScript this can be solved. Search "disable back button" in JavaScript forum section and you will get many post similar to your need.
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you'll have to add those response headers to every page on which you want to disable caching. You cannot add it to logout page and think that it will work on every page...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic