• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Logout

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi I am Abhijit. I coded this small module which uses session. But i want the logout functionality. Thus i used invalidate() function . This is my code


The rest is working good, it is printing the name - value pair in the while loop
My main concern is how to write a code which is based on login-logout function . If somebody help me it is very good for me.
When I click logout link it is going to login page, but when i again click the back button of the browser, it is again going back to the previous page instead of redirecting to the same login page
so please help me
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For Log out functionality you need to kill the session using invalidate method.like as follow


the below article is good example for login and logout.

http://www.javaworld.com/javaworld/jw-09-2004/jw-0927-logout.html
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The OP is already doing session.invalidate(). When you click back, you see the logged in page back, it's most probably the cached page been shown by the browser. So, we need to restrict the browser caching.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic