I am aware that in sessions_start handler function, the session object is not yet set.

Since I can't use the session object, are there alternative ways to check if you are logged in in this function handler?

1 Answer 1


If there is no session, then there is no logged in user. All of the user login code runs after the sessions_start hook.

  • I looked at sessions_end. It has the same problem. I used these session hooks because I wanted to set a session variable(language). Are there any hooks that can do this job? Commented Feb 26, 2014 at 5:38
  • 1
    Yes, sessions_end is your ticket in. Look at libraries session.php. The hook provides $this (i.e. the session class itself) and the userdata is in $this->userdata
    – GDmac
    Commented Mar 28, 2014 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.