I'm having a lot of trouble grabbing the existing session data from a logged in user via a standalone script on the same domain. I'm writing a module that's heavy on the ajax and it uses an external php that needs access to the current session.
I have included bootstrap.inc, called drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL), and all that. But I just can't seem to grab the session or know how to associate the right cookie with the right row in the "session" table of the db. I still "see" the cookie session_id on the browser side, but I don't know how to grab the one I need.
More specifically, I need to access the $user variable, as well as a custom variable I set with $_SESSION. Whenever I do a session_start() I get an "ini_set has already started" error. So that's not really working out either.
Please shed any insight you may have on this issue.
Thank you in advance!
Karen