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

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

Post by S01aX3N0YX » Thu, 06 Apr 2006 02:28:02


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.
 
 
 

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

Post by Juan T. Ll » Thu, 06 Apr 2006 02:39:34

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.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.yqcomputer.com/
asp.net faq : http://www.yqcomputer.com/
foros de asp.net, en espal : http://www.yqcomputer.com/
===================================

 
 
 

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

Post by S01aX3N0YX » Thu, 06 Apr 2006 02:55:02

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?
 
 
 

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

Post by Juan T. Ll » Thu, 06 Apr 2006 03:40:33

re:

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.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.yqcomputer.com/
asp.net faq : http://www.yqcomputer.com/
foros de asp.net, en espal : http://www.yqcomputer.com/
===================================
 
 
 

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

Post by sirfunus » Thu, 06 Apr 2006 03:51:51

Um, try it and see??
 
 
 

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

Post by S01aX3N0YX » Thu, 06 Apr 2006 04:57:02

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

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

Post by Kevin Spen » Thu, 06 Apr 2006 19:19:59

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.
 
 
 

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

Post by gerr » Tue, 11 Apr 2006 12:38:51

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