0

Is it possible for two different web pages to use the same cookie? For example, some news sites now have buttons on the bottom, where if you are logged into facebook, you can just click the button to "like" the article. Is this a case of a 3rd party website using facebook's cookie to know which account you are, and if so, is there a way I can control it?

I'm not sure how the new "like" system works, so maybe the button part isn't actually on the news site, but hosted on facebooks servers or something, so it's really facebook itself accessing its own cookie. If that's the case, is there a way I can choose when a site accesses its own cookie?

Thanks for any help!

1 Answer 1

0

Each website is only able to access and manipulate its own cookie, but you can use frames and iframes to display a different website's widget on your site (and allow it to access its own cookie).

In the case of Facebook's button, you're referencing a PHP script and Javascript on Facebook's site, which are able to access the Facebook cookie.

For example:

<a name="fb_share" type="button" share_url="http://example.com" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

If you want to restrict a site's ability to access its own cookie, you would have to either configure your browser settings as you usually would (some browsers can be configured to always prompt you whether or not to allow cookies for certain sites), configure something like NoScript to prevent the JavaScript from running unless you explicitly allow it, or set up a firewall rule that blocks traffic to the site in question.

1
  • Thanks, that makes a lot of sense! I already have NoScript, so we should be good to go
    – Brett Johnson
    May 21, 2010 at 18:34

You must log in to answer this question.