Re: Problem with SESSIONS on Mac with Flash



Bill H schreef:
I need a work aorund for this. We are using sessions and all works
fine, except when a flash file is opened on a Mac and communicates
back to the php program on the server (using POST or GET). The problem
is that Flash on a Mac does not send the cookie information along, so
no session is attached to that request from the flash file.

Is there a way to switch on the fly from Cookie based sessions to URL
based sessions so that the Flash program can pass the session id
information to the php?

Bill H

I would asume that this is not working on other platforms either. To my knowledge, on Windows platforms for instance, Flash requests to backends don't send cookies along either. But I could be wrong. Anyway, a workaround would be something like the following:

- Upon requesting the page that incoorporates the flash movie make sure the session id is appended to the flash movie (using param/flashvars etc.)
- Then from within the Flash movie, upon each request to a php file that need this session id, send it along
- Then in the php file that handles the Flash request do something similar to this (presuming you use a POST request from Flash):

<?php

$sessionId = isset( $_POST[ 'sessionId' ] ) ? $_POST[ 'sessionId' ] : null;

// you might want to sanitize the $sessionId first

if( null !== $sessionId )
{

// set the session id to work with, BEFORE starting the session
session_id( $sessionId );
session_start();

$response = 'message=success';

}
else
{

$response = 'message=fail';

}

?>
.



Relevant Pages

  • Re: Problem with SESSIONS on Mac with Flash
    ... back to the php program on the server. ... is that Flash on a Mac does not send the cookie information along, ... no session is attached to that request from the flash file. ...
    (comp.lang.php)
  • Re: Flash & PHP Session
    ... I have an upload application written in PHP and Flash. ... the php page cannot access the $_SESSION. ... you append this to every GET request to php. ...
    (comp.lang.php)
  • Re: Flash & PHP Session
    ... I have an upload application written in PHP and Flash. ... the php page cannot access the $_SESSION. ... append this to every GET request to php. ...
    (comp.lang.php)
  • Re: Flash & PHP Session
    ... I have an upload application written in PHP and Flash. ... the php page cannot access the $_SESSION. ... you append this to every GET request to php. ...
    (comp.lang.php)
  • attracting attention with your tuner
    ... I was in a session recently with a bloke who had an electronic ... tuner which under some circumstances would flash its red and ...
    (uk.music.folk)