开发者

Does every browser open a new HTTPSession

I am working on a webbased application which has JSP and servlets. In my application, I am binding some objects to sessions like the following code --

HttpSession session = p_req.getSession();        
 session.setAttribute(DOWNLOAD_With_WARNINGS, downloadMap);

Later I am retri开发者_JAVA技巧eving them using session.getAttribute. I would like to know if every time I open a new browser does it open a new HTTP session. Because , if I do a setAttribute with some value in one browser instance, that change is visible when I do a getAttribute using the other browser instance.


The behaviour depends on browsers.

IE 6 - Everytime you open a new browser window, you'll have a new session. But if you open a new window using File - New menu, it will use the same session.

All the other browsers - Opening a new browser window will use the existing session.

To be sure, clear your cookies once.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜