简体   繁体   中英

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  

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM