Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

regarding log-out

 
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.
 
Sheriff
Posts: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • 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.
 
Ranch Hand
Posts: 2908
1
Spring Java 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: 2908
1
Spring Java 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: 2908
1
Spring Java 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: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • 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...
 
I'm not sure if I approve of this interruption. But this tiny ad checks out:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic