Preventing multiple browser sessions on the same server session

前端 未结 7 1960
时光取名叫无心
时光取名叫无心 2021-01-18 06:43

I\'m sure we\'ve all worked on, or are aware of web applications (especially in the enterprise) that have tightly bound themselves to the server session. In these cases, it

7条回答
  •  耶瑟儿~
    2021-01-18 07:07

    It is too late in the day. But you may wish to consider the option of generating a random string at the server and sending this to the frontend in a hidden form. Maintain the last random key for the session in the session object of the user. Everytime the user makes a request to the server send this random key back. Check the random key from the browser with the one stored in the session. If they do not match then you can tell the user that they should use the other window. Not very user friendly, but would work.

提交回复
热议问题