由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - One more servlet Q: Http Session
相关主题
java servlet httpsession问题求教Re: 有没有办法在browser第一次访问的时候知道是不是支持cookie?
有没有办法在browser第一次访问的时候知道是不是支持cookie?有weblogic的大牛或者spring security的大牛来帮帮忙吗?
JSP+SERVLET网站一般用下面方式来保存和传递变量和参数运行servlet时出现的http status 404问题
关于Jsp timeoutAnother Servlet Problem:Browser Caching
session lost between JSP and StrutsRun Servlet with Tomcat
How to invalidate a session?Help on compiling servlet with Tomcat
简单的EJB问题Please Help!
那里设置页面timeout?How to make php and servlet work togethe
相关话题的讨论汇总
话题: session话题: http话题: servlet话题: maybe
进入Java版参与讨论
1 (共1页)
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.
1 (共1页)
进入Java版参与讨论
相关主题
How to make php and servlet work togethesession lost between JSP and Struts
大家做JSP/Java开发的配置是怎样的?How to invalidate a session?
[转载] 急!在线等---从Servlet调用AXIS的Web Service 遇到问题!简单的EJB问题
Re: [转载] 急!在线等---从Servlet调用AXIS的Web Serv那里设置页面timeout?
java servlet httpsession问题求教Re: 有没有办法在browser第一次访问的时候知道是不是支持cookie?
有没有办法在browser第一次访问的时候知道是不是支持cookie?有weblogic的大牛或者spring security的大牛来帮帮忙吗?
JSP+SERVLET网站一般用下面方式来保存和传递变量和参数运行servlet时出现的http status 404问题
关于Jsp timeoutAnother Servlet Problem:Browser Caching
相关话题的讨论汇总
话题: session话题: http话题: servlet话题: maybe