Click here to Skip to main content
Sign Up to vote bad
good
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 - 9:40
Edited 25 Dec '12 - 9:45

Comments
Oleksandr Kulchytskyi - 25 Dec '12 - 16:01
Ouch , could you please explain for which purposes you allow log in process in two different tabs of the same application??

2 solutions

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  
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)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 414
1 Arun Vasu 253
2 OriginalGriff 200
3 CPallini 163
4 Aarti Meswania 158
0 Sergey Alexandrovich Kryukov 10,169
1 OriginalGriff 7,749
2 CPallini 4,181
3 Rohan Leuva 3,482
4 Maciej Los 3,089


Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid