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
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

pressing back button after logout shows loggedin contents  RSS feed

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

I am developing a website using struts2.
The website has login and logout functionalities.
After i logout i clear and invalidate my sessions, but if i go back to the previous page (with the browser back button), i am still able to see the previously logged in pages.

For example: I have a 'userName' session field in each page. On login the userName is set. On logout as the session is invalidated, the userName is set to null. But when i go to the previous page, i still see the userName set to the logged in value.

How do i prevent this and cause the page to be sent from the server. Thank you in advance
 
Sheriff
Posts: 9613
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Look here...
 
Bill Zelan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Report post to moderator
I tried that Ankit. But the problem still persists
 
Ankit Garg
Sheriff
Posts: 9613
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Did you use those headers on every page where you don't want the browser to cache your page??
 
Bill Zelan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Report post to moderator
S i tried inserting both


but it didnot work.

i find
in the headers
 
Bill Zelan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Report post to moderator
i found


here....


this works. thank you ankit.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Report post to moderator
friends i tried all these but it didnt help..

it still caching the data...i.e the name if the user and allowing him to come back to the home page after logout by pressing back button...




help guys...help...
 
Ankit Garg
Sheriff
Posts: 9613
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Are you actually using that code?? Its not valid HTML. You have a head tag after body tag, I can't see the starting html tag (I'm sure its there but you forgot to paste it here). If you check the link here, you only need to put 3 lines in the head tag of your html page. Nothing else is needed. The 3 lines are as follows
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!