Unique browser ID

  • Thread starter Thread starter Jason Barnett
  • Start date Start date
J

Jason Barnett

Is there a way to retrieve a unique identifier for a client browser instance,
from within an ASP.NET page?

I would like to identify a specific browser on a specific machine. I can
determine the machine's IP address, but I don't know how to retrieve a unique
browser ID (i.e. PID).
 
I beleive the closest you can get is just get the Session - and that is
browser specific,
but not window specific ( within the browser )

M.
 
Miro said:
I beleive the closest you can get is just get the Session - and that is
browser specific,
but not window specific ( within the browser )

M.

Actually, session ID's are issued by the server, and so, they are not
browser-specific. In fact, they have more to do with the browser window
than they do with the browser application, since one session cannot span
multiple browser windows, but one browser could have many sessions going
simultaneously.

-Scott
 
huh ?
what browsers/os are you referring to ?
all of the most popular ( ie, ff , op , ... ) current version browsers
running on windows create just one session per machine regardless of the
number of browser windows you have open - exactly the opposite to what you
just stated.
 
I take that back ( partly ) this is true for ie but does not apply to non-ms
browsers and does not apply to multiple tabs even in IE
 
germ said:
huh ?
what browsers/os are you referring to ?

Any and all of them.
all of the most popular ( ie, ff , op , ... ) current version browsers
running on windows create just one session per machine regardless of the
number of browser windows you have open - exactly the opposite to what you
just stated.

Uh no. A Session is server object which represents a "conversation" taking
place between a client and that server. Whenever a client (any client)
connects to a server that utilizes sessions, the server looks at the HTTP
request header to see if a session is referenced. If not, the server
generates a new session object and assigns a unique session ID to that
object. In addition, when the server sends down the response to the client,
the HTTP response header will include this session ID, which the client then
stores and will place into the next HTTP request header going back to that
server/domain.

Since a browser can have many windows/tabs open and each window/tab can be
getting content from completely unrelated servers/domains, sessions are not
shared across windows/tabs of a client and one browser instance can very
well be participating in several server sessions.

This simplest example of this would be to log on to two different online
banking sites using two different tabs of the same browser instance. Once
you log into to each bank site, you'll have two different and distinct
sessions going - one with each bank site. Since sessions are managed by the
server, not the client, each bank site is free to log you off after its own
pre-determined time of inactivity.

Again, sessions are not managed by the client and a client can have many
sessions going at once, but sessions are not shared across windows/tabs of a
client. This is true for all clients.

-Scott
 
True for 2 different sites ( and why would you care ) but this does not hold
true for two tabs or windows ( non-ie ) with connections to the SAME site
which is what I assume the was referring as this is am extremely common
question.
 
germ said:
True for 2 different sites ( and why would you care ) but this does not
hold true for two tabs or windows ( non-ie ) with connections to the SAME
site which is what I assume the was referring as this is am extremely
common question.

It may be an common question, but it does not have a clear answer as I have
been trying to explain.

The OP has asked: "Is there a way to retrieve a unique identifier for a
client browser instance, from within an ASP.NET page?".

Miro replied that a session ID would be browser specific and not window
specific. This is not true for the reasons I explained.

In addition, in enterprise environments, one site may have several
applications running within it and spawn a new window to that new
application(even though the visitor is still at the same "site") from a
hyperlink click, in which case a NEW session will be created.

The fact is that you cannot count on a single session to uniquely identify
one tab or window in a browser, even when one web "site" is involved because
that one web site may be running more than one web application.

And, don't forget about Session Cookies, wich operate differently and often
get mixed up with server Session objects. Also, what about cookie-less
sessions offered by ASP .NET? Now, the situation changes again.

-Scott
 
not sure what your definition of 'website' is, but 2 'applications' that
generate unique sessions when accessed from a single process, even though
they may be located at the same root domain are 2 different websites.

What Miro stated is correct, ( this is an ASP.NET group is it not ? )

Don't bother to respond - I won't
 
germ said:
not sure what your definition of 'website' is, but 2 'applications' that
generate unique sessions when accessed from a single process, even though
they may be located at the same root domain are 2 different websites.

That's exactly my point. And, as such you can't count on having one session
ID that would be the same in all windows/tabs.
What Miro stated is correct, ( this is an ASP.NET group is it not ? )

It's only correct if you are talking about access one site. But, if you
were then of course there would only be one session id.
Don't bother to respond - I won't

I don't really care if you do or not, I'm still going to correct you. The
OP wanted a way to uniquely id a browser from an ASP.NET page. If that
browser has tabs already open and engaged with a different site, then the
session ID that the OP's site hands out will NOT be able to uniquely id a
specific browser on a specific machine, since that browser will now have
multiple session ID's in memory from multiple servers.

And, as I said, if one domain has multiple applicaitons running on it, the
sessions returned by the different applications will not be the same.

-Scott
 
Scott,

In reference to your quote:
Miro replied that a session ID would be browser specific and not window
specific. This is not true for the reasons I explained.

I have a website and when I throw something in the " Session("bla") =
date.now if Session("bla") is empty

This seems to span accross "ALL" open tabs in my IE when I visit the same
page.
I seems I do not get a unique Session("bla") per "tab" within IE but I get
it per web browser.

I get a new Session("bla") date.now when I open the same website in chrome
lets say.

But If I have IE opened with 1 tab... lets say i get 12noon thrown into the
Session("bla") ... if i open another tab within IE...
it recognizes that the Session("bla") is not empty so it just spits out the
12noon.

If now I open up Google Chrome... i will get lets say 1pm ( in chrome ).

But I still seem to get my same Sessions objects accross ALL the tabs within
IE when accessing the same website/page.

I hope this makes sense.

If I did something by coding error - please let me know what to look for...
i would like it to act differently per tab.

Miro
 
Scott,

I read your post jsut above
It's only correct if you are talking about access one site.

Yes - that is what I was refering to. "The Same Website".

I beleive we are in agreement on that fact :-)

Cheers'

Miro
 
Back
Top