Page 1 of 1

Setting a Session in an iFrame, then can't retrieve the info

Posted: Fri May 19, 2006 8:04 pm
by robster
Hi all,

I have an iframe, it contains a php file that I set some session data with:

Code: Select all

$_SESSION['pos']['gst_total'] = $gst_total;
I check that the data has been placed in the session by calling this (in the same iframe file):

Code: Select all

echo "gstsession = ".$_SESSION['pos']['gst_total']."<br>";
It works by showing what was in $gst_total.




Now the problem! :) I try and retrieve the session info from the parent document (the one that declares the iframe), using the same command:

Code: Select all

echo "gstsession = ".$_SESSION['pos']['gst_total']."<br>";

and nothing! All it outputs is this:

Code: Select all

gstsession =
If anyone has any suggestions I'd really appreciate it.

Rob

Posted: Fri May 19, 2006 8:25 pm
by lafam
do you have session_start(); in both pages?

Posted: Fri May 19, 2006 8:29 pm
by robster
DING!!! :)

Thank you so much.


Rob