Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

end jsp session

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi -

Thank you all guys for you continuous support and helping people.

I have another question. I was trying to end the current session by calling invalidate() which doesn't seem to quite work. When I press the browsers back button, I am still able to perform all the funtions of the user who has logged in.

Any idea why this is happening?
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because everything is cached. This is a common problem which is tricky to resolve because different browsers handle caching in different ways. You might want to check out this thread in the Servlets forum where they have been discussing a very similar issue.
 
Hari priya
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi -

I was trying not to allow caching by using -

response.setHeader("Cache-Control","no-cache");

but still it doesn't seem to work. The login information still seemed to be cached and the user is able to perform all teh actions after hitting the logout button.

I can get back all the information by refreshing the page.
 
Sheriff
Posts: 67618
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure that the session is being invalidated?

Are you sure that the site has no logic that automatically logs users in from cookie data or elsewhere?

Are you sure that your actions actually check that a user is logged in before performing their processing?
 
Hari priya
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I finally got it to work. Thank you for responding to my problem.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having the same problem and want to flush out the session variables on log out. Could you tell me how to end the session.? I jus' write
<%=session.invalidate()%>
in the logout.jsp file. I wonder if that is enough to terminate all session variables.

Rishi.
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Rishi Kishoreshah!

According to the documentation for javax.servlet.http.HttpSession in the the J2EE 1.4 API Specification, the invalidate method "[i]nvalidates this session then unbinds any objects bound to it."
 
reply
    Bookmark Topic Watch Topic
  • New Topic