I was modifying Jason Hunter's SessionBindings servlet from Ch.7
of Java Servlet Programming when I discovered this. I think it's a
problem with WebSphere, but was wondering if anyone had ever seen
anything similar to this.
I've seen posts where people say that the actual session object
tends to hang around after a call to HttpSession.invalidate(), but
I've never seen a post where the objects in the session hang around
too!
Anyone have any ideas?
Michael
I have WAS 2.0 Adv. on NT4 w/ IIS4 and SP4.
In a servlet, I created a session object and put an object in the
session using putValue(). This object was intended to test
HttpSessionBindingListener behavior. Sure enough, when the object was
bound (and later unbound), the appropriate methods were called.
However, I tried to take things a step further. I called
session.invalidate() to get rid of the session near the end of my
servlet. After doing this, I was still able to call
session.getValue() and retrieve objects from the session as the last
step of my doGet() method! I would at least expect for the objects in
the session to be removed (set to null), even if the session object
itself stayed alive, but was marked invalid.
An operation like this should cause an IllegalStateException to be
thrown, but this does not seem to be the case. In fact, several of
HttpSession's methods should throw this exception when invoked on a
session that is no longer valid.
When I execute the servlet again, a new session is created, as
expected. However, it's what didn't happen before this that is
baffling me...
What in the world am I missing here? I can send some code if anyone
is interested...
Michael