CakePHP loses SESSION after a redirect

3

I'm doing an integration with Facebook Login. When the user clicks to log in using Facebook and accepts the application it is redirected to a method that creates a SESSION and redirects.

The problem is that the data in this SESSION gets lost when I try to retrieve it in the other link.

I've created a test method where it simply writes a session and another controller I retrieve this SESSION in a expected way.

For this reason I started to suspect that the problem might be in the type of data that comes along with the URL that Facebook redirects to my application.

In all places of my application I'm using $components = array('Session') .

How do I solve this problem?

    
asked by anonymous 26.01.2014 / 22:30

1 answer

1

How good to explain your question. I ended up having an idea as soon as I asked the question. The Facebook SDK tries to create a session_id. As in the CakePHP framework it's probably called first, it ended up overwriting CakePHP's SESSION.

I found this solution link

In the Facebook SDK file I simply put a call to use CakePHP's SESSION features before the include.

In the PHP SDK of Facebook, but precisely in the facebook.php file I have included the CakeSession :: read () call before the require_once:

CakeSession::read();

require_once "base_facebook.php";

Problem solved.

    
26.01.2014 / 22:48