Yes the session objects can be passed along servlet's.

Using the
HttpSession session = request.getSession(true);

Putting values into the session
session.putValue("login.user", username);

Getting the values from the session
String user = (String)session.getValue("login.user");

Invalidating the session
session.invalidate();


also check out this site
http://java.sun.com/docs/books/tutorial/servlets/client-state/session-t
racking.html




-----Original Message-----
From:   Yee, Darren H [mailto:[EMAIL PROTECTED]]
Sent:   Thursday, May 13, 1999 1:41 AM
To:     [EMAIL PROTECTED]
Subject:        Session question

Hi all,

I have the following questions about sessions:

-       Can session objects be accessed across servlets (that is,
create a
session in one servlet, get session in another servlet) running in the
same
servlet engine instnace?  Different servlet engine instances?

Here's how I came up with this question.  I have a login servlet that
authenticates a user and creates a session.  I also have another
servlet
that handles other application logic.  The login servlet is served off
a
secure web services (JWS), and the application servlet is served off
a
regular web service.  I wasn't sure if the application servlet will be
able
to get the session object created in the login servlet.  After some
experimentation, I've found that sessions can be accessed across
servlets in
the same and different web service.  I was wondering if this is a
property
of the JWS or if there is a behavior dictated in the servlet spec.  My
guess
is that there is some requirement that sessions must be able to be
accessible by all servlets in a servlet engine instance or across
engine
instances.  I'm not sure if JWS uses the same instance of the servlet
engine
for its sercure and regular web service.

Any info would be appreciated.

Cheers,
Darren

_______________________________________________________________________
____
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources:
http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to