[Phpug] session weirdness

Kae Verens kae at webworks.ie
Fri Jun 29 14:28:36 IST 2007


Hi all - weird problem here.

In my KFM application, I use sessions to keep track of various stuff and help 
generally avoid checks that have just been done a moment ago in another request.

I have a multiple-file-uploader written in Flash, which appears to be trashing 
the session, though.

You can see the problem by downloading the nightly version of KFM from 
http://kfm.verens.com/nightly/ and installing it somewhere - make sure that 
your configuration includes username/password authentication, as this appears 
to be part of the problem.

load it up, and upload an image. With no user authentication, the image will 
be uploaded okay, but with user authentication turned on, the image will not 
be uploaded.

on inspection, it appears that the session is being overwritten by the flash 
upload request.

this should not be happening. Let's say the session id is "abcd". When you log 
in, the flash upload is told to send the SID whenever it is uploading. 
initialisation.php checks for that and is supposed to establish contact with 
the existing session using session_id('abcd') before the session_start().

I've found that if the session_id() is commented out, the upload fails but the 
session is still existing for general HTML/AJAX usage.
   If session_id('abcd') is run, though, then instead of establishing contct 
with the existing 'abcd' session, it creates a new one and overwrites the 
'abcd' session file with it.

Anyone have any ideas? This one has had me ripping at my hair since yesterday 
noon.

Kae


More information about the Phpug mailing list