I am trying to upgrade an existing Facebook Login within an Expressionengine based site from API v1.0 to v2.2 as per the FB platform upgrade requirements. As the Javascript SDK is not an option (due to integration with the EE members module) I have opted to use the PHP SDK v4.
I have a working Login URL but when the user returns from the Facebook login URL, after signing in, getSessionFromRedirect() returns NULL, instead of a session.
I have scoured the internet and reviewed the answers posted for people with similar problems but none of the solutions have worked:
The function to generate the FB login URL looks similar to this:
public function generate_fb_url(){
$tags = $this->EE->TMPL->tagdata;
$vars = array();
$redirect='http://redirect.com/?ACT=123';
$config=array('redirect'=>$redirect);
$this->EE->load->library('facebook_lib', $config, 'facebook');
array_push($vars, array('status'=>'true', 'error'=>'', 'fburl'=>$this->EE->facebook->login_url(), 'debug'=>'redirect -'.$redirect));
return $this->EE->TMPL->parse_variables($tags, $vars);
}
It simply initiates the CI Facebook library and creates the FB URI. As soon as the user is returned from Facebook the application dies and doing a var_dump($this->session); returns NULL.
Any input would be greatly appreciated, I’m tearing my hair out at the moment! I have a horrible feeling that the problem is related to Expressionengine’s handling of sessions but I could be wrong.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.