I have a situation in which I my application receives an XML post which I parse, store the values in session variables, and return a forwarding URL with a session ID as a GET variable. That external application then forwards to my application where I pick up the SID and open that session, with all of the parsed variables.
Here's the tricky part that I can't get to work. I open that session with session_id($SID), which works. I then want that session to become the main session, but the next POST I do to another page, when I do a session_start(), it starts an empty session.
I've tried to trick it, and open the previous session, grab the session array, close the previous session and open a new session, and create the array, as such:
session_id($sid);
session_start();
$old_session=$SESSION;
$SESSION=array();
session_destroy();
session_unset();
session_start();
$_SESSION=$old_session;
This only works temporarily, since again, the next page I go to, session_start() starts a new session again.
The really annoying thing is the XML entry is an add-on to my application. When I log on normally, through a login page, session_start() always starts the same session and I have no problems.
I do notice that cookies do not seem to be being used.. even though I use:
ini_set('session.use_only_cookies',1);
I would see the cookies on my client if they were being used, right? I assume the problem would then go away because session_id($SID) apparently resets the cookie to the proper session id.
Any way to ensure cookies are being used?
thanks
Adam