简体   繁体   中英

Facebook JS SDK and sub-domains

I realise there are some questions about this already but I'm still a little confused!

For someone to login on my website using Facebook they are directed to secure.mydomain.com. Will the cookie be available on www.mydomain.com after the user has logged on or not? If not then how do I make it available across all domains.

I believe there is a bug in this area https://developers.facebook.com/bugs/256155664428653?browse=search_4e843e6d89a232275456793 but I'm not sure if this has been resolved yet???

Regards

The bug you mentioned is already closed.

Even if cookie is set on your sub-domain and will not be available to server side until set on other sub-domain, if you call FB.init with status equal to true fresh login status of user will be fetched by JavaScript SDK and cookie will be set/updated.

When I went to your bug link it says: Status: Fix Ready . So in my mind, they haven't deployed the bug fix yet.

However, on each page, no matter the subdomain, you should always call FB.getLoginStatus() (after FB.iniit()) and grab the access token from it's response.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM