Bruce
Bruce

Reputation: 911

How to detect some unique browser instance number, or pid number per "window" or per "tab"

I'm writing a web app, and I have the classic problem that the session cookie is shared between browser instances, and browser tabs. Obviously the browser doesn't send back anything the header. However I am able to control all the requests inside the app, so I'm wondering if I can add my own "parameter".

So the question is, is there some JavaScript which might identify the process ID, or Instance ID, or Tab ID on the client side? I can take care of sending it to the server, but I'm wondering if anyone knows of any tricks on the browser side.

Browser-specific suggestions are welcome - I'm very happy with answers that will only work in one browser type.

Upvotes: 6

Views: 10658

Answers (2)

Alex
Alex

Reputation: 344

sessionStorage might help you here.

http://www.nczonline.net/blog/2009/07/21/introduction-to-sessionstorage/

update: window.name can be used.

Upvotes: 0

Giann
Giann

Reputation: 3192

Here is the list of information you can get from javascript: Information about your Web Browser from Javascript. I don't think you can get system specific information like PIDs from javascript, it would certainly be a security issue.

Upvotes: 4

Related Questions