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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

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

Post 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
lafam
Forum Newbie
Posts: 4
Joined: Fri May 19, 2006 7:18 pm

Post by lafam »

do you have session_start(); in both pages?
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

Post by robster »

DING!!! :)

Thank you so much.


Rob
Post Reply