This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Regarding Invalidation of JSP Session  RSS feed

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

Currently, I am facing the problem is that when I logout of the application, I am still able to access a page by typing the URL of the page into the browser.

For example,
http://localhost:8080/appname/createuser.jsp
[url=http://localhost:8080/appname/userreport.jsp?id=%27M7681%27]http://localhost:8080/appname/userreport.jsp?id='M7681'[/url]

when user clicks on logout option heis redirected to a jsp page where the
session.invalidate(); is used. But it doesn't help to overcome this problem.

Can anyone help me for avoiding this situation?

Thanks in advanced.

Regards,
Varsha Pardeshi
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
session.invalidate() only ensures that the session used by the loged in client destroys, but this will not prevent him from reaching another page on the server. For preventing you must check for proper session value on that page. In your case i think there is no proper checking for session values in the page you loaded after logout. Chek this out.
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set the following headers in your code

 
Varsha Pardeshi
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Vishnu Prakash:
set the following headers in your code



Hello Vishnu,
Thanks for your reply. I had added the code for header, still my problem has not solved. Please can you give some details about this?

Regards,
Varsha Pardeshi
 
Ranch Hand
Posts: 1090
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest that you should not only depend of pages not being cached. I would suggest as suggested earlier by Ajith. Use some logic in the JSP's that makes sure that the pages you are trying to open do have a session value set.
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Varsha, when user login, put session.setAttribute(�validLogin�,�true�) and when user logout put session.setAttribute(�validLogin�,�false�)

You need to have a filter that check for values of validLogin for each request. If value found false, redirect to some another page, if values found true let request to be processed.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!