Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Session empty in my ajax controller (Controller_Rest)
  • For some reason I have a session problem in my ajax controller in one of my FuelPHP apps... $_SESSION is empty and I can't figure out why. I am using DB driver like in all of my apps, and this is the first time I encounter this. Any tips what could cause this? FuelPHP version is 1.5.
  • actually if I try to access $_SESSION fuel says Undefined variable: _SESSION pointing to session_start() problem?
  • FuelPHP doesn't use PHP native sessions, and therefore $_SESSION does not exist.

    You interact with the session through the Session class: http://fuelphp.com/docs/classes/session/usage.html
  • Yes I tried that as well, still empty!

    Session::get('user') => null
  • Since you're storing the session data in the database, you should be able to see what is stored in the session. It's a serialized array, so it should be readable.
  • Yes I know that, and I already checked. Session vars are there and visible inside serialized data but as I said in my ajax rest controller are not accessible... No clues why because I use exact same ajax controller setup in other apps and haven't had problems so far!
  • Harro sorry to bother you again but looks like again a Warden issue... I will need to see whats happening. Thanks for helping!
  • No problem. If it is indeed a Warden issue, you might want to inform the maintainer to get it fixed.
  • Sure, I've pushed quite few fixes already. As far as I can see warden user gets lost in my ajax controller, very strange... and this only in this app, working fine elsewhere.
  • Hi Jume,
    did you resolve this issue?

Howdy, Stranger!

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

In this Discussion