How to detect new Machine like Facebook?

前端 未结 8 2077
花落未央
花落未央 2021-02-04 06:58

I am actually trying to detect a person, using a computer, Just like facebook. Whenever you sign into facebook using different machine, it detects the new machine and asks you t

8条回答
  •  再見小時候
    2021-02-04 07:27

    This process has very little to do with cookies, it's called fingerprinting.

    Basically, you can look at the functionality and support of your browser and there is a likelihood that the combination will be somewhat unique.

    You can test this out here: https://panopticlick.eff.org

    JavaScript example, but the theory can be transposed to any language: http://valve.github.io/fingerprintjs2/

    Using this in combination with cookies is the best way to detect unique devices. Store the fingerprint in a hidden field when you login and check that against the available fingerprints you've already got.

提交回复
热议问题