Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Session attribute keeps coming back null

843833Jun 30 2003 — edited Oct 23 2003
I have a jsp to log in new users. Once a user logs in, I set a userId session attribute in my login servlet.

session.setAttribute("userId", userId);

If the login is valid, I flow to a second servlet to retrieve information based on that user. However, when I try and access the session userId, I get a null value.

userId = (String) session.getAttribute("userId");

Any ideas why I might be losing session information in my second servlet?

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 20 2003
Added on Jun 30 2003
7 comments
509 views