Reputation:
I have a web application written in ASP.NEt/C# and javascript. It uses session variables.
When I open the application, is there a way to check if the application is running in another tab?
Or do you have any ideas on making session variables unique for each tab?
Any help would be great!
Thanks
Kev.
Upvotes: 0
Views: 1602
Reputation: 21
You can use Session.IsNewSession() method to check For the Particular Session is a New one. Normally in web browsers with Multi Tabs the session is same through out that window
Upvotes: 2
Reputation: 5264
First understand sessions. The session is a file which lives on the server and holds some data. When the user gets a session they are really getting a cookie with some key to find which session is theirs.
Because of this, between different tabs in the same browser the cookie will be the same so it will access the same session on the server in both tabs. You can make them unique by when you start the session giving a random ID but this (to my knowledge) will simply overwrite the previous session's value...
Upvotes: 4