Click here to Skip to main content
15,895,256 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have the following problems:

I am developing an application in Asp.Net 4.0 under C# 4.0. When a user logs into the application using, let's say a browser "tab" and another user logs into the same application using another 'tab', one of the tabs will change immediately its content (users data) into the other tab's. It is very frustrating and any help/ solution to handle this would be WELCOME.
Posted
Updated 25-Dec-12 9:45am
v2
Comments
Oleksandr Kulchytskyi 25-Dec-12 16:01pm    
Ouch , could you please explain for which purposes you allow log in process in two different tabs of the same application??

Although I can't figure out what your purpose is, consider followings:
- cookies are linked to domains, thus if you use cookie based authentication and/or session, you can not separate the logins between tabs not even between browser instances (with one exception: due to it's purposes, "private" or "incognito" browser sessions are totally separated from the normal ones)
- thus if you want to be able to separate logins as you wrote, you have to disable cookies for session and authentication, see: http://msdn.microsoft.com/en-us/library/aa479314.aspx[^], http://msdn.microsoft.com/en-us/library/aa479315.aspx[^], http://www.asp.net/web-forms/videos/authentication/how-to-setup-and-use-cookie-less-authentication-in-an-aspnet-application[^]
 
Share this answer
 
Two things you can do:

1) Prevent the user from opening a new tab for your application. For this search google for "preventing multitab browsing of asp.net application". There are a number of ways, one which is good is using javascript which uses window name.

2) Enable cookieless session. This will make your URL look ugly but will let you use multiple tabs for different users without any clash of session ids.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900