Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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 25-Dec-12 10:40am
Edited 25-Dec-12 10:45am
v2
Comments
Oleksandr Kulchytskyi at 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??
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  

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



Advertise | Privacy | Mobile
Web03 | 2.8.150327.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100