How to differ sessions in browser-tabs?

后端 未结 21 1409
情深已故
情深已故 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:21

    We had this problem and we solved it very easy. I mean easy because no programming involved. What we wanted to do was to let a user login to multiple account within same browser window without conflicting the sessions.

    So the solution was random subdomains.

    23423.abc.com
    242234.abc.com
    235643.abc.com
    

    So we asked our system admin to configure the SSL certificates for *.abc.com rather abc.com Then with little code change, every time a user try to login, he gets logged in a tab with a random subdomain number. so each tab could have its own session independently. Also to avoid any conflict, we developed the random number using a hash or md5 of user id.

提交回复
热议问题