Sharing session between two different web browser

前端 未结 3 981
無奈伤痛
無奈伤痛 2020-12-21 06:39

I want to make a PHP web application in which on a single PC there can only be one authentication session at a time i.e. User A login using

3条回答
  •  Happy的楠姐
    2020-12-21 07:29

    You can accomplish this task (assuming your working with general users, who doesn't try to spoof User-Agents and other tricks) by using a signature algorithm which identifies a device. Your algorithm can have as many variables as you see fit.

    For example REMOTE_ADDR, USER_AGENT. Other special variables can be obtain by executing a flash based code on the client side. As each request comes in you can compare it with existing keys that are authenticated and if you get a new session where all variables match except a Browser String you can safely assume its the same user using a different browser.

    You must collect extra variables using a flash component for this to work. the variables available via $_SERVER is not sufficient. Because there could be users behind proxies and you do not want to identify them as false positive.

提交回复
热议问题