Cookieless sessions in MVC cause shared session between seperate tabs in the browser

StackOverflow https://stackoverflow.com/questions/22956154

  •  30-06-2023
  •  | 
  •  

سؤال

I am trying to avoid the problem whereby users of the site I am working on can open a new browser tab and end up sharing the same session.

I tried to use cookieless sesisons, but consensus is that cookieless sessions are not supported in MVC, but do work under certain conditions

Definitive not supported answer here: ASP.NET MVC and using cookieless sessions

This seems like a hack, especially as you cant use POST: MVC2 Cookieless Session Issue using POST

So how do you prevent multiple tabs being seen as the same session on the server please?

هل كانت مفيدة؟

المحلول

browser tabs share the same session id because the id comes from the browser. HTML5 SessionStorage, window.sessionStorage, addresses this limitation. That might not be viable depending on the backwards compatibility you need.

This goes into much more depth. How to differ sessions in browser-tabs?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top