You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Propes, Barry L " <ba...@citi.com> on 2007/05/11 20:28:24 UTC

strange session behavior!

Ok,
 
I've had an app running in place just fine for several months now.
 
All of a sudden, I've got some weird happenings.
 
I'll preface my problem by saying that I had added an extra security constraint to the file. If I need to show that code for assistance, I'll pass it along later.
 
But long story short, most people's userIDs are working fine, as associated with their roles and email addresses (a column I added).
 
I'm using this code for part of my app:
 
String juser = request.getRemoteUser();
request.getSession().setAttribute("juser",juser);
String jusertwo = (String) request.getSession().getAttribute("juser");
out.println("Juserval is: "+juser);
out.println("Jusertwo is: "+jusertwo);
 
When I look at the screen (browser console), for most users I've tested, I see it set just fine.
 
For one particular user, it is breaking and looking like this:

Juserval is: TG39054 Jusert
It's odd, because it's breaking for this one user, EVEN though I've changed both their email address and USERid.
 
I have no idea what could be causing this. I did add one user with a totally different role than that of what had been included before, and the other person's ID with the new role did appear directly before this person with the problem. Could a hashmap in another app affect this? I wouldn't think it would directly. Especially if I've changed the person's userID and email address.
It is so strange.
 
FWIW, I am using TC 4.1.31.
 
Let me know if any other XML attributes or other code is needed.
 
Thanks!
 
Barry
 
 

Re: strange session behavior!

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
Hi Barry.... I think you session may not have been created...
See my MOD below....

----- Original Message ----- 
From: "Propes, Barry L " <ba...@citi.com>

I'm using this code for part of my app:

String juser = request.getRemoteUser();

request.getSession(true).setAttribute("juser",juser); // make sure the 
session is created
//request.getSession().setAttribute("juser",juser);

String jusertwo = (String) request.getSession().getAttribute("juser");
out.println("Juserval is: "+juser);
out.println("Jusertwo is: "+jusertwo);

When I look at the screen (browser console), for most users I've tested, I 
see it set just fine.

For one particular user, it is breaking and looking like this:

Juserval is: TG39054 Jusert
It's odd, because it's breaking for this one user, EVEN though I've changed 
both their email address and USERid.

I have no idea what could be causing this. I did add one user with a totally 
different role than that of what had been included before, and the other 
person's ID with the new role did appear directly before this person with 
the problem. Could a hashmap in another app affect this? I wouldn't think it 
would directly. Especially if I've changed the person's userID and email 
address.
It is so strange.

FWIW, I am using TC 4.1.31.

Let me know if any other XML attributes or other code is needed.

Thanks!

Barry




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org