Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unique Browser Sessions/ID's????

Status
Not open for further replies.

DJSmith

Programmer
Aug 14, 2000
82
GB
Hey,

I have a web application that uses session variables, however I also need to get some information. Because the user is likely to have multiple web browsers using the application at the same time I need to be able to distinguish between the different browser instances. Is there such as thing as a Browser Session or a unique Browser ID?

Thanks

DJ.
 
I recommend you make it clear to users not to open more than one window. This is a natural limitation of browser-based applications just like not hitting the "back" button and forcing a reload after form posts. From the server's point of view, there are never more than one browser window for a session.

I tried getting around this limitation once and came up with a complex solution. I built a task manager object and a corresponding JSP tag that duplicated the functionality of <jsp:useBean/>, except internally it used the task manager to generate a task id and create a bean. From then on, the window would keep the task id as a hidden form field and pass it on from page to page, and the tag would always use that id to retrieve the bean associated with the id from the task manager and place it in the request collection. This way multiple windows could do different tasks because each had a different task id.

I abandoned this approach eventually because it seemed unwieldy, and it compromised the MVC pattern. I told users to just never open new windows, and they're getting along fine to this day. This is what I recomment to everybody.

&quot;News and views of some obscure guy&quot;
 
The short answer is that the Browser controls that behavior so you can't.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top