It's not a secret anymore!
The moose likes Servlets and the fly likes active session loses attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "active session loses attribute" Watch "active session loses attribute" New topic

active session loses attribute

M. Pr�pper

Joined: May 17, 2004
Posts: 4

The problem is that an active session loses an attribute without explicitly removing it by setting it to null. Here's how and when it happens:
An apache web server runs an index html file. This file has a link to a servlet: upon clicking, the call is redirected to a second, Tomcat server that hangs behind the apache server and cannot be called directly itself.

The servlet creates a session and sets an attribute. When you return to the index file and then visit the servlet again, the session is preserved, but the attribute gets lost. Has anyone got a clue?
Thanks, Marc
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
Why do you think that you are seeing the same session? Sounds to me like you are getting a new one every time.
M. Pr�pper

Joined: May 17, 2004
Posts: 4
You're right. They were different sessions. Unintendedly, but all the same true, so thanks for directing me towards the answer.
I agree. Here's the link:
subject: active session loses attribute
It's not a secret anymore!