Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.††If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 17th, 2005, 01:14 PM
Authorized User
 
Join Date: Sep 2004
Location: Mumbai, , India.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to someshtrivedi
Default Multiple Browser Problem

When I open two browsers(both instance of browser run the same application) on my computer and log in first as one person and then log into the second one as a different person. The first browser becomes the second user also.
Normally web applications dont behave this way, can u please suggest me whats going wrong and possibly some solution for it.

Somu.

Reply With Quote
  #2 (permalink)  
Old January 17th, 2005, 03:49 PM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,957
Thanks: 79
Thanked 1,556 Times in 1,533 Posts
Default

*Most* web applications work this way. When you open a new window using Ctrl+N or File | New Window, both browser windows will share the same cookie collection (and other settings).

Since authentication is often done with cookies, both browser windows will submit the same cookie's so effectively you become the other user in the other browser window.

To avoid this, start a new instance of a browser, instead of opening a new window from the current one.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old January 18th, 2005, 03:51 AM
Authorized User
 
Join Date: Sep 2004
Location: Mumbai, , India.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to someshtrivedi
Default

Thanks Imar
Is there anyway to solve the above problem ???

Reply With Quote
  #4 (permalink)  
Old January 19th, 2005, 02:59 PM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,957
Thanks: 79
Thanked 1,556 Times in 1,533 Posts
Default

Probably not.

This is the way the Web was built. A connection between a browser and a Web server is stateless. This means that as soon has you have been served the page you requested the Web server forgets about you. To enable a Web site to track those "anonymous" users / connections, cookies can be used. Whenever you request a page, the browser also submits the cookie collection that falls within the scope of your request. So, both browser windows will submit the same cookies, making it appear they are the same user from (quite possibly) the same browser window. The fact that your end user is actually using two windows is not visible to the Web server.

Maybe this can be done with client side JavaScript, but I am not even sure how to do it, or wether it's possible at all.

Why is this so important to you?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Falling Away With You by Muse (Track 6 from the album: Absolution) What's This?
Reply With Quote
  #5 (permalink)  
Old February 28th, 2005, 12:09 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,413
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Keep in mind also that you will never be able to control how the user opens a new window except when you are using client side script. And in that case, the browser will be opened as a sibling/child window and will most likely share cookies. Different browsers will handle this differently however.

-Peter
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PROBLEM WITH XML DISPLAY IN BROWSER jceaser1254 XML 7 April 21st, 2007 04:45 AM
Problem in using Browser in Winforms jay69 C# 0 December 5th, 2006 05:49 AM
Problem with xml and layers in different Browser. diptanjan XML 0 March 9th, 2006 09:40 AM
Multiple browser instances Dilip Nagle Classic ASP Basics 1 September 29th, 2005 11:33 PM
Inherits Problem In Browser (Urgent) helga@trisyn.co.za ASP.NET 1.0 and 1.1 Basics 1 September 27th, 2005 10:24 AM



All times are GMT -4. The time now is 10:44 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.