473,695 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Flash & PHP Session

Hi,

I have an upload application written in PHP and Flash. The PHP page
gets the file information via $_POST. Moreover, the user never
actually visits the PHP page, rather Flash sends the information to the
PHP page and then loads the result, all in the background. Right now,
the php page cannot access the $_SESSION. Is there anyway that I can
conitnue the PHP session when doing this or does the user have to visit
the PHP page?

Thanks.

Steve

Aug 20 '06 #1
10 29895
Steve Cook wrote:
Hi,

I have an upload application written in PHP and Flash. The PHP page
gets the file information via $_POST. Moreover, the user never
actually visits the PHP page, rather Flash sends the information to the
PHP page and then loads the result, all in the background. Right now,
the php page cannot access the $_SESSION. Is there anyway that I can
conitnue the PHP session when doing this or does the user have to visit
the PHP page?

Thanks.

Steve
Looks like your flash isn't sending the session cookie along with the
rest of the request.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Aug 20 '06 #2

Jerry Stuckle wrote:
Steve Cook wrote:
Hi,

I have an upload application written in PHP and Flash. The PHP page
gets the file information via $_POST. Moreover, the user never
actually visits the PHP page, rather Flash sends the information to the
PHP page and then loads the result, all in the background. Right now,
the php page cannot access the $_SESSION. Is there anyway that I can
conitnue the PHP session when doing this or does the user have to visit
the PHP page?

Thanks.

Steve

Looks like your flash isn't sending the session cookie along with the
rest of the request.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Do you have an idea how I can get flash to send the session cookie?

Aug 20 '06 #3
Steve Cook wrote:
Jerry Stuckle wrote:
>>Steve Cook wrote:
>>>Hi,

I have an upload application written in PHP and Flash. The PHP page
gets the file information via $_POST. Moreover, the user never
actually visits the PHP page, rather Flash sends the information to the
PHP page and then loads the result, all in the background. Right now,
the php page cannot access the $_SESSION. Is there anyway that I can
conitnue the PHP session when doing this or does the user have to visit
the PHP page?

Thanks.

Steve

Looks like your flash isn't sending the session cookie along with the
rest of the request.

--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@att global.net
============= =====


Do you have an idea how I can get flash to send the session cookie?
I think you're going to have to ask that in a Flash newsgroup. We're
PHP programmers here.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Aug 20 '06 #4

Jerry Stuckle wrote:
Steve Cook wrote:
Jerry Stuckle wrote:
>Steve Cook wrote:

Hi,

I have an upload application written in PHP and Flash. The PHP page
gets the file information via $_POST. Moreover, the user never
actually visits the PHP page, rather Flash sends the information to the
PHP page and then loads the result, all in the background. Right now,
the php page cannot access the $_SESSION. Is there anyway that I can
conitnue the PHP session when doing this or does the user have to visit
the PHP page?

Thanks.

Steve
Looks like your flash isn't sending the session cookie along with the
rest of the request.

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attg lobal.net
============== ====

Do you have an idea how I can get flash to send the session cookie?

I think you're going to have to ask that in a Flash newsgroup. We're
PHP programmers here.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
I definitely know how to pass the session_id via flash. I guess I
should have asked how do I manually set the session_id value in PHP?
In other words how do I populate the session_id variable?

Aug 21 '06 #5
Steve Cook wrote:
Jerry Stuckle wrote:
>>Steve Cook wrote:
>>>Jerry Stuckle wrote:
Steve Cook wrote:
>Hi,
>
>I have an upload application written in PHP and Flash. The PHP page
>gets the file information via $_POST. Moreover, the user never
>actually visits the PHP page, rather Flash sends the information to the
>PHP page and then loads the result, all in the background. Right now,
>the php page cannot access the $_SESSION. Is there anyway that I can
>conitnue the PHP session when doing this or does the user have to visit
>the PHP page?
>
>Thanks.
>
>Steve
>

Looks like your flash isn't sending the session cookie along with the
rest of the request.

--
=========== =======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@a ttglobal.net
=========== =======
Do you have an idea how I can get flash to send the session cookie?

I think you're going to have to ask that in a Flash newsgroup. We're
PHP programmers here.

--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@att global.net
============= =====


I definitely know how to pass the session_id via flash. I guess I
should have asked how do I manually set the session_id value in PHP?
In other words how do I populate the session_id variable?
You don't. PHP does, based on the session id passed back by the browser
- which is stored in a cookie.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Aug 21 '06 #6

"Jerry Stuckle" <js*******@attg lobal.netschree f in bericht
news:i8******** *************** *******@comcast .com...
Steve Cook wrote:
>Jerry Stuckle wrote:
>>>Steve Cook wrote:

Jerry Stuckle wrote:
>Steve Cook wrote:
>
>
>>Hi,
>>
>>I have an upload application written in PHP and Flash. The PHP page
>>gets the file information via $_POST. Moreover, the user never
>>actuall y visits the PHP page, rather Flash sends the information to
>>the
>>PHP page and then loads the result, all in the background. Right now,
>>the php page cannot access the $_SESSION. Is there anyway that I can
>>conitnu e the PHP session when doing this or does the user have to
>>visit
>>the PHP page?
>>
>>Thanks.
>>
>>Steve
>>
>
>Looks like your flash isn't sending the session cookie along with the
>rest of the request.
>
>--
>========== ========
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@ attglobal.net
>========== ========
Do you have an idea how I can get flash to send the session cookie?
I think you're going to have to ask that in a Flash newsgroup. We're
PHP programmers here.

--
============ ======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@at tglobal.net
============ ======


I definitely know how to pass the session_id via flash. I guess I
should have asked how do I manually set the session_id value in PHP?
In other words how do I populate the session_id variable?

You don't. PHP does, based on the session id passed back by the browser -
which is stored in a cookie.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
I beg to differ:

Do something like:

<?php
ini_set('sessio n.use_cookies', '0');
session_start() ;
?>

Put your flash movie in the same page and echo the SID behind it (old school
style):

<object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=6,0,29,0"
width="32" height="32">
<param name="movie" value="whatever .swf?<?php echo SID ?>">
<param name="quality" value="high">
<embed src="whatever.s wf?<?php echo SID ?>" width="32" height="32"
quality="high" pluginspage="ht tp://www.macromedia. com/go/getflashplayer"
type="applicati on/x-shockwave-flash" sid=""></embed></object>

This will give you access to the variable PHPSESSID in flash. Make sure you
append this to every GET request to php.

Notice though that appending session ID's to GET request are often
considered a security risk. But since you are using flash and thus requests
are made in the background (not through addressbar requests), it's somewhat
safer to use IMO.

Cheers
Aug 21 '06 #7

"amygdala" <no*****@norepl y.comschreef in bericht
news:44******** **************@ news.kpnplanet. nl...
>
"Jerry Stuckle" <js*******@attg lobal.netschree f in bericht
news:i8******** *************** *******@comcast .com...
>Steve Cook wrote:
>>Jerry Stuckle wrote:

Steve Cook wrote:

>Jerry Stuckle wrote:
>
>
>>Steve Cook wrote:
>>
>>
>>>Hi,
>>>
>>>I have an upload application written in PHP and Flash. The PHP page
>>>gets the file information via $_POST. Moreover, the user never
>>>actual ly visits the PHP page, rather Flash sends the information to
>>>the
>>>PHP page and then loads the result, all in the background. Right
>>>now,
>>>the php page cannot access the $_SESSION. Is there anyway that I can
>>>conitn ue the PHP session when doing this or does the user have to
>>>visit
>>>the PHP page?
>>>
>>>Thanks .
>>>
>>>Steve
>>>
>>
>>Looks like your flash isn't sending the session cookie along with the
>>rest of the request.
>>
>>--
>>========= =========
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>js******* @attglobal.net
>>========= =========
>
>
>Do you have an idea how I can get flash to send the session cookie?
>

I think you're going to have to ask that in a Flash newsgroup. We're
PHP programmers here.

--
=========== =======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@a ttglobal.net
=========== =======
I definitely know how to pass the session_id via flash. I guess I
should have asked how do I manually set the session_id value in PHP?
In other words how do I populate the session_id variable?

You don't. PHP does, based on the session id passed back by the
browser - which is stored in a cookie.

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
============== ====

I beg to differ:

Do something like:

<?php
ini_set('sessio n.use_cookies', '0');
session_start() ;
?>

Put your flash movie in the same page and echo the SID behind it (old
school style):

<object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=6,0,29,0"
width="32" height="32">
<param name="movie" value="whatever .swf?<?php echo SID ?>">
<param name="quality" value="high">
<embed src="whatever.s wf?<?php echo SID ?>" width="32" height="32"
quality="high" pluginspage="ht tp://www.macromedia. com/go/getflashplayer"
type="applicati on/x-shockwave-flash" sid=""></embed></object>

This will give you access to the variable PHPSESSID in flash. Make sure
you append this to every GET request to php.

Notice though that appending session ID's to GET request are often
considered a security risk. But since you are using flash and thus
requests are made in the background (not through addressbar requests),
it's somewhat safer to use IMO.

Cheers
Ooops I didn't thoroughly read the whole thread. I didn't read that a
session was already started.

Forget about the ini_set('sessio n.use_cookies', '0'); part.

And do (untested):

<object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=6,0,29,0"
width="32" height="32">
<param name="movie" value="whatever .swf?PHPSESSID= <?php echo session_id()
?>">
<param name="quality" value="high">
<embed src="whatever.s wf?PHPSESSID=<? php echo session_id() ?>" width="32"
height="32" quality="high"
pluginspage="ht tp://www.macromedia. com/go/getflashplayer"
type="applicati on/x-shockwave-flash" sid=""></embed></object>

Then in the php page that handles flash requests:

<?php
session_id($_GE T['PHPSESSID']);
session_start() ;
?>

Should do the trick. But maybe I'm overlooking something here.
Aug 21 '06 #8

"amygdala" <no*****@norepl y.comschreef in bericht
news:44******** **************@ news.kpnplanet. nl...
>
"amygdala" <no*****@norepl y.comschreef in bericht
news:44******** **************@ news.kpnplanet. nl...
>>
"Jerry Stuckle" <js*******@attg lobal.netschree f in bericht
news:i8******* *************** ********@comcas t.com...
>>Steve Cook wrote:
Jerry Stuckle wrote:

>Steve Cook wrote:
>
>>Jerry Stuckle wrote:
>>
>>
>>>Steve Cook wrote:
>>>
>>>
>>>>Hi,
>>>>
>>>>I have an upload application written in PHP and Flash. The PHP page
>>>>gets the file information via $_POST. Moreover, the user never
>>>>actuall y visits the PHP page, rather Flash sends the information to
>>>>the
>>>>PHP page and then loads the result, all in the background. Right
>>>>now,
>>>>the php page cannot access the $_SESSION. Is there anyway that I
>>>>can
>>>>conitnu e the PHP session when doing this or does the user have to
>>>>visit
>>>>the PHP page?
>>>>
>>>>Thank s.
>>>>
>>>>Steve
>>>>
>>>
>>>Looks like your flash isn't sending the session cookie along with the
>>>rest of the request.
>>>
>>>--
>>>======== ==========
>>>Remove the "x" from my email address
>>>Jerry Stuckle
>>>JDS Computer Training Corp.
>>>js****** *@attglobal.net
>>>======== ==========
>>
>>
>>Do you have an idea how I can get flash to send the session cookie?
>>
>
>I think you're going to have to ask that in a Flash newsgroup. We're
>PHP programmers here.
>
>--
>========== ========
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@ attglobal.net
>========== ========
I definitely know how to pass the session_id via flash. I guess I
should have asked how do I manually set the session_id value in PHP?
In other words how do I populate the session_id variable?
You don't. PHP does, based on the session id passed back by the
browser - which is stored in a cookie.

--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
============= =====

I beg to differ:

Do something like:

<?php
ini_set('sessi on.use_cookies' , '0');
session_start( );
?>

Put your flash movie in the same page and echo the SID behind it (old
school style):

<object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http ://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=6,0,29,0"
width="32" height="32">
<param name="movie" value="whatever .swf?<?php echo SID ?>">
<param name="quality" value="high">
<embed src="whatever.s wf?<?php echo SID ?>" width="32" height="32"
quality="hig h" pluginspage="ht tp://www.macromedia. com/go/getflashplayer"
type="applicat ion/x-shockwave-flash" sid=""></embed></object>

This will give you access to the variable PHPSESSID in flash. Make sure
you append this to every GET request to php.

Notice though that appending session ID's to GET request are often
considered a security risk. But since you are using flash and thus
requests are made in the background (not through addressbar requests),
it's somewhat safer to use IMO.

Cheers

Ooops I didn't thoroughly read the whole thread. I didn't read that a
session was already started.

Forget about the ini_set('sessio n.use_cookies', '0'); part.

And do (untested):

<object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=6,0,29,0"
width="32" height="32">
<param name="movie" value="whatever .swf?PHPSESSID= <?php echo session_id()
?>">
<param name="quality" value="high">
<embed src="whatever.s wf?PHPSESSID=<? php echo session_id() ?>" width="32"
height="32" quality="high"
pluginspage="ht tp://www.macromedia. com/go/getflashplayer"
type="applicati on/x-shockwave-flash" sid=""></embed></object>

Then in the php page that handles flash requests:

<?php
session_id($_GE T['PHPSESSID']);
session_start() ;
?>

Should do the trick. But maybe I'm overlooking something here.
And once again, I didn't read thoroughly anough:
>This will give you access to the variable PHPSESSID in flash. Make sure
you append this to every GET request to php.
Should of course be: POST variable to php

And then in the php page that handles flash requests:

<?php
session_id($_PO ST['PHPSESSID']); // instead of $_GET[...]
session_start() ;
?>

lol
Aug 21 '06 #9
<snip>
>>>>>Is there anyway that I can
>conitnue the PHP session when doing this or does the user have to visit
>the PHP page?
<snip>

So basically; what I'm trying to say here is: Yes, you need flash embedded
in _a_ (not _the_) php script (within the same domain of course) to read the
cookie, and Jerry was right. ;)

As a last resort to ommitting flash put in a php file, you could use
javascript to read the cookie and append the PHPSESSID var. But you would
have to rely on the user having javascript turned on. Which is a rather big
no no.

Also, I've been out of webdeveloping for a while, so I'm not sure whether
this is still allowed by the majority of browsers anyway.

HTH
Aug 21 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3151
by: Astra | last post by:
Hi All I have a Javascript to detect whether a client's browser has flash installed, but as so many people are putting me off relying on Javascript, could you please let me know if you know how to detect whether a browser has flash installed using ASP. Many thanks. Robbie
0
1538
by: Bernie | last post by:
Hi All, I have a weird problem with using flash on aspx pages. It goes like this: I have some links with query string parameters in the page. The same links appear as regular "a href" and also embeded in a flash button. like the following: <a href="/Products.aspx?level=2&prodID=26">Antibodies</a> in the flash:
5
5943
by: ASP.NET explorer | last post by:
I have been asked to create some simple animation using Adobe Flash player in ASP.NET(C#) web application. While I am fairly well versed with ASP.NET C#, I absolutely have NO IDEA about how to say "Hello World" in a Flash enabled web page rendered via ASP.NET. Can any one let me get started? ---
3
2014
by: vinceboy | last post by:
Hi..guys.I am newbie here and have a page which need to load two different flash element with session control.However something went wrong in the code and cause the first if clause is not working.I try to echo out what I want before the if clause but it displayed nothing. Thanks for your generious help.. <?php echo $_SESSION; if (isset($_SESSION)){ ?> <tr> <td colspan="2"> <div align="center">
0
5474
by: dolittle | last post by:
Hi, I'm embedding a last.fm flash widget. I want to be able to remove it from the page using javascript. I've tried to delete the html element that contains the code but it keeps playing in IE. In FF it stops playing but I can't tell if it is removed or not. Can I do it in javascript or maybe I need a FLASH script to do it?
4
4045
by: benjaminkang | last post by:
I'm very new to Coldfusion and action script, but due to job requirements, i got allocated the task of developing a cfm page where the user logs in using the embedded swf file and everything was working fine, till i decided to add the Application.cfm file for session variables. Whenever i remove the application.cfm, everything works fine.But if i add it in again, nothing works again.... *sigh* Error given out by flash is : Error opening...
0
1564
by: benjaminkang | last post by:
I'm very new to Coldfusion and action script, but due to job requirements, i got allocated the task of developing a cfm page where the user logs in using the embedded swf file and everything was working fine, till i decided to add the Application.cfm file for session variables. Whenever i remove the application.cfm, everything works fine.But if i add it in again, nothing works again.... *sigh* Error given out by flash is : Error opening...
0
9132
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8864
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8838
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6506
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5842
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4351
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3024
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1986
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.