How to Detect if Another Site Set a Cookie?

2 replies
Is it possible to detect if another website set a cookie?

For example, on my website could I detect if a visitor had a cookie set by the Warrior Forum? I would not need to know the content of the cookie, just if warriorforum.com had set amy cookie. Then if true I could offer something special to visiting Warriors.
#cookie #detect #set #site
  • Profile picture of the author espradley
    This is not possible.

    It is possible however to set cookies for other domains.

    For instance, if you knew the owner of warrior forum, the could use the
    set_cookie() command and specify your site as being able to read it.

    One common way of doing this is to use pixel tracking. You give the pixel code to the person you want to track. They put it on their page. When a user opens the page, it creates a cookie on their browser for your site.

    Don't think Warrior Forum will be open to this however.
    Signature

    Eddie Spradley

    {{ DiscussionBoard.errors[2816400].message }}
  • Profile picture of the author wayfarer
    The only way it would be possible to read a cookie from another site is if you had some sort of agreement with that website. It is technically possible to program a system that allows you to open a connection to that website (through an iframe or image) with some special information attached to it (your user id or something). Then if your user is logged into that site or any cookies are present, the third party site could register an association with your user id and the visitor's cookies or account information.

    It wouldn't end there, however, as the third-party site would then have to expose some sort of API to retrieve the information. Facebook does something similar to this to allow certain app builders to recognize Facebook users when they visit. Technically, it would then be possible for Facebook to share whatever information about you that they want to, which is why browsers cannot do this by default. There are serious privacy implications.
    Signature
    I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
    {{ DiscussionBoard.errors[2817030].message }}

Trending Topics