Loading ...
Sorry, an error occurred while loading the content.

Re: Uploader and PHPSESSID

Expand Messages
  • darrellgrundy
    After more investigation with another client (uploadify) and getting similar results, I managed to create a server side log to see what is going on and it
    Message 1 of 4 , Aug 3, 2009
    • 0 Attachment
      After more investigation with another client (uploadify) and getting similar results, I managed to create a server side log to see what is going on and it seems to be caused by the setting of the session ID.

      Even by setting the session ID to a passed $_GET parameter, as follows:

      session_id($_GET['sid']);
      session_start();

      ... then echo'ing out sid later into an error log and then echo'ing out session_id(), I find the two session values to be different?? WTF?!?

      Has anybody seen a situation like this before - I realise now that it's not YUI related, but just in case it rings a bell with someone. I checked the php.ini parameters and there's nothing obviously fishy in there, such as session.auto_start set to false for example.

      Thanks.
    • darrellgrundy
      OK, fixed this issue with uploadify - as a temp hack I was sending the PHPSESSID value through in the param for folder name and the code was automatically
      Message 2 of 4 , Aug 3, 2009
      • 0 Attachment
        OK, fixed this issue with uploadify - as a temp hack I was sending the PHPSESSID value through in the param for folder name and the code was automatically prefixing this with a '/' - when I assigned it via session_id(), php rejected it as it contained an illegal '/' character for the session id and generated a new one. And now back to the original Yahoo Uploader issue.
      • darrellgrundy
        So managed to fix this - it was a syntax issue - basically not rtfm ing properly. Required syntax for passing the POST params is:
        Message 3 of 4 , Aug 3, 2009
        • 0 Attachment
          So managed to fix this - it was a syntax issue - basically not rtfm'ing properly. Required syntax for passing the POST params is:

          uploader.uploadAll("http://site.com/photo_upload.php", "POST", {PHPSESSID: "'; echo session_id(); echo '"}, "Filedata");


          ... i.e. you need the double quotes surrounding the session_id so that it results in {PHPSESSID: "12345656789"}

          And then at the server side the following:

          session_id($_POST['PHPSESSID']);
          session_start();

          ... now works like a charm.

          That's me over and out good buddies. =;
        Your message has been successfully submitted and would be delivered to recipients shortly.