Js-sdk工作麻烦,但Php-sdk 3.1.1 getUser()函数有时返回0

Js-sdk工作麻烦,但Php-sdk 3.1.1 getUser()函数有时返回0

问题描述:

Firstly I want to say I know little english.

I have seeking about this problem for 1 day. I found a lot similar article and I tried solutions but I could not solve problem.

Js-sdk working troubleless and I can capturing /me with FB.api but I want to capture /me on server side for registration because anyone can change user informations that getting from client side.

Sometimes $facebook->getUser() return zero, usually chrome but sometimes work without any problem so I can not find where is the problem ? and what is the solution ?

How can I solve this problem ?

Thanks for helping.

When getUser() returns 0, just redirect the user to the normal login url, and if they're logged in correctly, then they should come back to your app and then getUser() should return the correct value.