File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How To Check Whether User Is Logged In? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How To Check Whether User Is Logged In? " Watch "How To Check Whether User Is Logged In? " New topic
Author

How To Check Whether User Is Logged In?

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I have many servlets in my application. I use container-based authentication; e.g. the container intercepts to verify the user's membership as soon as the LOGON button is clicked and the user submits his/her name and password. After container has done its job, normal logical flow resumes.
I want to check whether user is logged in and wheter a session object exists already when each servlet is called. I do not think that I can use isUserInRole() because there are four different roles.
My concern is what I store in a session could be overwritten if the user has more than one browser window open. How do I handle the situation?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How To Check Whether User Is Logged In?