Check if third-party cookies are enabled

前端 未结 6 1389
既然无缘
既然无缘 2020-11-27 10:58

I have an application that needs to check whether the client browser has third-party-cookies enabled. Does anyone know how to do this in JavaScript?

6条回答
  •  失恋的感觉
    2020-11-27 11:10

    My solution works by loading a

    If you prefer to run it asynchronously, you may use the async and defer attributes.

    This also works with jQuery:

    
    

    Here is the third-party-cookies.php code. This must be hosted on a different domain. The server must support PHP:

提交回复
热议问题