Re: Problem with SESSIONS on Mac with Flash
- From: amygdala <example@xxxxxxxxxxx>
- Date: Wed, 21 Jan 2009 09:02:52 +0100
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';
}
?>
.
- Follow-Ups:
- Re: Problem with SESSIONS on Mac with Flash
- From: Bill H
- Re: Problem with SESSIONS on Mac with Flash
- References:
- Problem with SESSIONS on Mac with Flash
- From: Bill H
- Problem with SESSIONS on Mac with Flash
- Prev by Date: Re: Plattform independent queuing of computations
- Next by Date: Re: testing for https
- Previous by thread: Problem with SESSIONS on Mac with Flash
- Next by thread: Re: Problem with SESSIONS on Mac with Flash
- Index(es):
Relevant Pages
|