$url = 'http://xxxxxx.com:8052/php/myproject/';
$loginUrl = $facebook->getLoginUrl(array(
'scope' => 'publish_stream,email',
'redirect_uri' => $url,
));
$facebook->getUser() will have 0.
That is because my server is using port 8052 for http(Sharing IP with other server)
It is not working if I use port number at redirect_uri.
I am sure the domain setting is correct at Facebook.com
How to solve this?
This is not programming problem, i am using port forward for the tomcat server. 8052->tomcat
You can’t get correct 8052 port if you are using port forward, always get 80 by php code.
In the Facebook SDK, base_facebook.php
You can see it will get url from function getCurrentUrl, go to edit it
I preset session server_port by using javascript(can get correct port), now use it as the port by the above code, the try the following code can get correct url which can getUser() after login.
PS: It seems okay if input url by my self