spedy
spedy

Reputation: 2360

How does Facebook connect Like button to your FB account

I am planning on creating something similar to Facebook's like or Twitter follow button.

So I have a site with a user base and some social networking content. How would I show on my website whatever a user clicks on a different arbitrary site containing my "Follike" button.

So I suppose some of the steps that would probably need to be taken:

How would specific elements work and how would they communicate with each other?

A simple Proof of concept suggestion would be more than helpful. Thanks!

EDIT:


Ah of course, FB and Twitter use cookies to retrieve user information from arbitrary websites and connect the like button to your FB account.

Upvotes: 0

Views: 92

Answers (1)

Gaston Sanchez
Gaston Sanchez

Reputation: 1211

This is my theory of how they do it.

When you insert the FB button into your website, it gets replaced by an iframe. Then that iframe points to a FB url, and from that url it has access to all the cookies in the facebook.com domain, there they get your info and return the like button with your account info linked to it.

Upvotes: 1

Related Questions