Now, I know this may be an odd way to go about this, and I'd more than appreciate nudges/guidance into a proper direction, but right now I'm stuck at the end of this:
On the same server but outside of Moodle's root, I am trying to verify if a user is currently logged in to Moodle (in regards to loosely integrating the Phorum application, to be specific). To do this, I am accessing the MoodleSession cookie, searching on the 'sesskey' field and retrieving 'sessdata', and here's where I'm stuck.
It appears that its an object (that's just a guess) stored in a longtext field, and I cannot figure out how to convert into something I can access/parse/whatever. When I attempt to use the data returned, I get something like "Resource id 20". I cannot access the member variables of it, as it is not returned as an object.
Any help here would be appreciated.
-Jason
Have you tried doing a var_dump? This should tell you exactly what the variable is that you're looking at
Mike
Mike
We have tried using the var dump and all it gives us is a simple string Moodle#19 or Moodle #20. Is there a way to access the info that is usually in the $USER global externally using the cookie?
This can be solved be setting separate individual cookie instance and pulling from that cookie.
The session data is stored in a serialized format - use the unserialize() function to return the text back into it's original format
