I have an action that accepts uploads from a Flash-based upload component.
Because Flash has a separate HTTP session from the browser, the common technique is to put your PHP session id in the POST along with the upload, so that’s what I did, and it worked fine for a long time.
In the action that accepts the POST from Flash, I use the following code to restore the session:
Yii::app()->session->sessionID = $_POST['SESSION_ID'];
Yii::app()->session->init();
Pretty straight-forward stuff.
Recently, we switched to CDbHttpSession as the session manager component for this application - everything else works normally, but the above technique no longer works.
Rather than restoring the existing session data, when I use the code above, it "resumes" with the existing session ID, but clears out all the existing session data! So you get session with the correct ID, but all your session data is gone - and on the next page load in the browser itself, you are then redirected and prompted to log in again…
Could this be a bug in CDbHttpSession?
Or is there a different technique that will enable me to correctly resume a session with a given ID?