Sooraj Bathery
Sooraj Bathery

Reputation: 155

Separate sessions once opening the same web page on two different tabs of the same browser Asp.net C#

Is it possible create Separate sessions once opening the same web page on two different tabs of the same browser

<sessionState mode="InProc" cookieless="UseUri"></sessionState>

I don't want to display the URL like

http://localhost/SampleWeb/(S(afdg3ires1ik0lmjm3pkjtzl))/default.aspx  

Upvotes: 1

Views: 2325

Answers (1)

brainless coder
brainless coder

Reputation: 6430

That depends on your implementation -

  1. If you are using the cookie session that the browser created itself and using this inside your application, then NO. It is not possible. Because this depends on the browser and the browsers usually use the same session, (which is saved in a cookie and only one cookie namespace exists for one site) for multiple tabs.

  2. But if you are using cookieless session and using session key as url parameters, then this is possible. In this case you might have to implement or use your own custom session manager to manage sessions.

ASP.Net probably has a Cookieless session management system, but I haven't used that one before. You might wanna try that. You can find the documentation here -

Cookieless Session

If you use cookieless session, then the session key is appended with the urls and thus you can consider different tabs as if they are different browser tabs, so this might work for you. Because in this scenario, there is no way the browser could identify both are same sites and should use the same session, as they are not using cookies.

Upvotes: 2

Related Questions