开发者

How is facebook connect pop up window designed?I

开发者 https://www.devze.com 2023-02-06 19:49 出处:网络
I click on connect to facebook and a pop takes me directly to the facebook domain from the iframe which belongs to mydomain. But after successfull 开发者_开发技巧authentication how does it automatical

I click on connect to facebook and a pop takes me directly to the facebook domain from the iframe which belongs to mydomain. But after successfull 开发者_开发技巧authentication how does it automatically close and get to the event handle?

In other words, whats going on behind FB.login()?


Once it receives a successful auth key, It will close the dialog window. Just like OAuth works when you get a code on a successful authentication


I havent researched this, but this is my guess: I think Facebook is setting a signed cookie on the client's machine if there is a successful authentication. The Facebook JS library recognizes this cookie when it's set and closes the window.


EDIT: It uses postMessage supported by HTML5 to support cross window cross domain communication!

0

精彩评论

暂无评论...
验证码 换一张
取 消