Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
FuelPHP not logging in correctly through ajax REST.
  • Hi everyone,

    We have a REST controller set up to authenticate and sign up our users.  It is working correctly when using PHP and our iOS app but when we try to do it on our front end site using Angular, it says that it logs in correctly and it gives us a has, but the Auth::check() is not passing and any other calls we try to make give us an unauthorized access response as if the user is not logged in.

    Is there something that we need to do differently when using ajax?

    Thanks!
  • HarroHarro
    Accepted Answer
    Auth uses the session to store the logged-in credentials, and the cookie to track the session. So your client must support cookies, and be able to send them back and forth.

    If your client doesn't, the session class supports several alternatives, such as a post variable or header data. All available options are mentioned in the docs, under Session configuration.
  • Ok great, I will take a look at the docs, thank you.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion