Saturday, February 19, 2011

CakePHP and Flex - How to keep $this->Auth->user() valid ?

Hey all.... I am having a little bit of difficulty to make the integration between flex and cakephp to work with authentication...

I have an MVC on Flex that comunicates with Users MVC on cakephp. It authenticates and sends me back the logged user, but when I try to access another controller, the value for $this->Auth->user() is allways empty....

The Authentication is not persistent....

The funniest thing is that... If I login first on cakephp (through cakephp view) and then start working on the Flex side, everything works just fine, until the timeout is reached.... Something is being done when I call /users/login through cakephp that does not work when I call the service through flex....

Additional Information: I am using CakeAMF/amfext and Fake to make this integration possible

Any idea ?

From stackoverflow
  • It seems that cookie is the problem....

    When logging from Flex, the cookie with CAKEPHP key to the session is not created....

    The only solution so far is to log from Cake and redirect to Flex...

    It seems that the session is mantained while working on Flex app

0 comments:

Post a Comment