r*****s 发帖数: 985 | 1 I got some weird problem with session handling. Maybe I
misunderstand something about session. Don't the objects
stored in the session belong to the current session only?
Why can other sessions get the objects?
Here, I put a service reference to session:
session.setAttribute(SERVICENAME, ref);
Should I add the session id too to distinguish the key?
session.setAttribute(SERVICENAME+session.getId(), ref);
Could Qing DX give give some light on it?
Thanks! |
Q**g 发帖数: 183 | 2 I am not sure about this.
My understanding is that a session is unique for each conversation between
the browser and the server.
I guess in your case you are actually in one session. I mean, maybe a child
browser window(eg. pop windows) is in the same session as the parent. But if
you start a new browser window manually, you should be in different sessions.
【在 r*****s 的大作中提到】 : I got some weird problem with session handling. Maybe I : misunderstand something about session. Don't the objects : stored in the session belong to the current session only? : Why can other sessions get the objects? : Here, I put a service reference to session: : session.setAttribute(SERVICENAME, ref); : Should I add the session id too to distinguish the key? : session.setAttribute(SERVICENAME+session.getId(), ref); : Could Qing DX give give some light on it? : Thanks!
|
r*****s 发帖数: 985 | 3 that's what I understand ... the situation is, even different users
with different browsers can get the reference object from the session.
Isn't it weird? BTW, my web server is Tomcat. Is there any bug with it
for the session implementation?
【在 Q**g 的大作中提到】 : I am not sure about this. : My understanding is that a session is unique for each conversation between : the browser and the server. : I guess in your case you are actually in one session. I mean, maybe a child : browser window(eg. pop windows) is in the same session as the parent. But if : you start a new browser window manually, you should be in different sessions.
|
w******t 发帖数: 1422 | 4 I don't think so. try to print out session id , I believe you'll see they are
in same session.
child
if
sessions.
【在 r*****s 的大作中提到】 : that's what I understand ... the situation is, even different users : with different browsers can get the reference object from the session. : Isn't it weird? BTW, my web server is Tomcat. Is there any bug with it : for the session implementation?
|
m******t 发帖数: 2416 | 5
session id is typically sent back through either a cookie or part of
the url. should be fairly easy to see.
【在 w******t 的大作中提到】 : I don't think so. try to print out session id , I believe you'll see they are : in same session. : : child : if : sessions.
|
r*****s 发帖数: 985 | 6 thanks. i did print out the session ids. they are different for sure.
【在 w******t 的大作中提到】 : I don't think so. try to print out session id , I believe you'll see they are : in same session. : : child : if : sessions.
|
A**o 发帖数: 1550 | 7 Since everything you test looks right, let's think the other way:
maybe you assign these session the same reference?
【在 r*****s 的大作中提到】 : thanks. i did print out the session ids. they are different for sure.
|