How to differ sessions in browser-tabs?

后端 未结 21 1358
情深已故
情深已故 2020-11-22 08:48

In a web-application implemented in java using JSP and Servlets; if I store information in the user session, this information is shared from all the tabs from the same brows

21条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 09:06

    How to differ sessions in browser-tabs?
    

    The most straightforward way to differ sessions in browser tabs is to disallow your particular domain to set cookies. That way, you can have separate sessions from separate tabs. Say you disallow cookies from this domain: www.xyz.com. You open Tab 1, login and start browsing. Then you open Tab 2, and you can login either as a same user or a different one; either way, you will have a session separate from Tab 1. And so on.

    But of course this is possible when you have control over the client side. Otherwise, the solutions prescribed by the folks here should apply.

提交回复
热议问题