Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to implement logout functionality?

 
prateek saluja
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all, I am a beginner and developing my first application in Java.
I m developing a simple bidding system but am not able to implement the logout fuctionality. Can anyone please help me on this?? What should i use for implementing this functionality.
Thanks
[ November 25, 2007: Message edited by: Bear Bibeault ]
 
Pavel Kubal
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can add an attribute into the session after successful login and in logout logic remove this attribute. In case of closing the browser without logout the session will expire automatically.
 
abhishek jethwani
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when you create a login functionality, you create a session and the attribute for the session. for logout you have to delete all the attributes in session variable which you create within the application and direct that to the login servlet again.

in this way you will attend the logout function as you have observe it on many other sites.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calling session.invalidate will take eliminate the need to explicitly delete everything from your session object.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
Calling session.invalidate will take eliminate the need to delete verything from your session object explicitly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic