aspose file tools*
The moose likes Servlets and the fly likes how to implement logout functionality? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to implement logout functionality?" Watch "how to implement logout functionality?" New topic
Author

how to implement logout functionality?

prateek saluja
Greenhorn

Joined: Nov 25, 2007
Posts: 2
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

Joined: Mar 13, 2004
Posts: 356
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

Joined: Aug 11, 2006
Posts: 14
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

Joined: Dec 11, 2004
Posts: 13410

Calling session.invalidate will take eliminate the need to explicitly delete everything from your session object.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Ben Souther:
Calling session.invalidate will take eliminate the need to delete verything from your session object explicitly.
 
jQuery in Action, 2nd edition
 
subject: how to implement logout functionality?