dazzle
dazzle

Reputation: 35

same session ID being generated across different IE windows

I have observed on IE 8 windows 7 machine, whenever I open my application on separate IE windows, the same session ID gets generated for each of them.

I was expecting different session ID's for different windows.

Does anyone knows why this is happening.

Code used to generate session ID

HttpSession session = request.getSession();

Upvotes: 2

Views: 6630

Answers (2)

EricLaw
EricLaw

Reputation: 57115

Things changed between IE7 and IE8 with regard to how new sessions are created. In IE8, choose File > New Session to create a new browser session.

You should read my article on this topic: http://blogs.msdn.com/b/ieinternals/archive/2010/04/05/understanding-browser-session-lifetime.aspx

Upvotes: 3

Anthony Grist
Anthony Grist

Reputation: 38345

Multiple Internet Explorer windows (and tabs) share the same process (assuming you opened the second window from within Internet Explorer), and therefore have the same cookies. Since your session ID is likely being stored in a cookie, this is why you get the same session ID for multiple windows.

Running separate Internet Explorer processes (or using IE plus another browser) should allow you to simulate multiple sessions.

Upvotes: 0

Related Questions