How to differ sessions in browser-tabs?

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

    Spring Session supports multiple session in same browser Look at the samples and implementation detail http://docs.spring.io/spring-session/docs/current/reference/html5/guides/users.html

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-11-22 09:24

    You shouldn't. If you want to do such a thing either you need to force user to use a single instance of your application by writing URLs on the fly use a sessionID alike (not sessionid it won't work) id and pass it in every URL.

    I don't know why you need it but unless you need make a totally unusable application don't do it.

    0 讨论(0)
提交回复
热议问题