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

how to do LOGOUT with servlet

Yi Meng
Ranch Hand

Joined: May 07, 2003
Posts: 270
say i have basic authentication for some resources.
the user first has to login, no problem. But what if the user wants to logout? The desired should be that the user can still view other non-protected web pages and if the user wants to view those protected pages, it should prompt the user to login again. How to do this?


Meng Yi
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30938
    
158

It depends on how you are doing the authentication. If you are doing it yourself, you can put something in the session when they login successfuly. When they logout, delete that from the session. They can still look at other pages. If they try to look at a protected page, it will look for that value in the session and reprompt them.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
 
subject: how to do LOGOUT with servlet