Quick one - Is SESSION per browser instance or per IP Address?

G

Guest

We have a question here where a developer says that if the same user starts 2
instances of the application on his machine, the session variables may get
mixed up b/c the session is PER IP ADDRESS. I thought each browser instance
had its own session and the two instances of the application would never get
mixed up? Thanks.
 
J

Juan T. Llibre

That's easy enough to test, isn't it ?

All you have to do is place this :

<%=Session.SessionID%>

in an otherwise empty page...and call the page with different browser instances.

IE recycles the same SessionID for all browser inatances.
Firefox forces a new SessionID for each browser instance.

You might want to test other browsers.
 
G

Guest

Yes, I read that IE uses the same session ID, but what about session
variables that I create? For example,
Session["USERID"] = id;

Then if I open another browser and click on another user, a different ID
should be stored to the session variable. Will the 2 browsers confuse the
USERID session variable?
 
J

Juan T. Llibre

re:
Will the 2 browsers confuse the USERID session variable?

No.

You will have individual session contents in each browser's session.

btw, the SessionID is recycled by IE only when Session.Abandon is called.
In normal operation, IE will get different sessions for each instance that is opened.

I just opened 3 browser instances with IE, and they all had different session ID's.

I wouldn't worry too much about that.





KMZ_state said:
Yes, I read that IE uses the same session ID, but what about session
variables that I create? For example,
Session["USERID"] = id;

Then if I open another browser and click on another user, a different ID
should be stored to the session variable. Will the 2 browsers confuse the
USERID session variable?

Juan T. Llibre said:
That's easy enough to test, isn't it ?

All you have to do is place this :

<%=Session.SessionID%>

in an otherwise empty page...and call the page with different browser instances.

IE recycles the same SessionID for all browser inatances.
Firefox forces a new SessionID for each browser instance.

You might want to test other browsers.
 
G

Guest

Um, I am new at this and wasn't entirely sure of the way to go about testing
it. Thanks for the help though.
 
K

Kevin Spencer

It is per browser instance. If using frames, it may be more than one per
browser instance.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.
 
G

gerry

not necessarily
if you right click on a link and select "open in new window"- you will have
2 browser instances using the same session
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,955
Messages
2,570,117
Members
46,705
Latest member
v_darius

Latest Threads

Top