Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem setting PHP SESSION variables within cross-domain iframe
    primarykey
    data
    text
    <p>Coles Notes version:</p> <p><code>index.php?map_id=foo</code> is loaded into iframe on www.not-my-domain.com. index sets <code>SESSION['map_id']</code> = foo. Flash file tries to get <code>SESSION['map_id']</code> thru Authenticate.php, but Authenticate.php has no values set for <em>any</em> <code>SESSION</code> varaibles.</p> <p>-- Only first-load, cross domain issue.</p> <p>Verbose:</p> <p>I have an index while where I set: <code>SESSION['map_id'] = foo</code></p> <p>The index file then loads a flash file. When initialized, the flash accesses an 'Authenticate.php' file which echo's out the <code>SESSION['map_id']</code> and is loaded into flash via <code>LoadVars</code>. Flash then displays the appropriate data. <em>This step cannot be done another way</em></p> <p>This all works just fine on our main site. The issue comes when we try to port out to other sites by providing iframe embed codes:</p> <pre><code>&lt;iframe src="http://www.mydomain.com/?map_id=foo&amp;code=bar" ... &gt;&lt;/iframe&gt; </code></pre> <p>On a fresh load of the embed code from another site (www.anotherdomain.com), it seems that the <code>SESSION</code> variables have been destroyed, as flash simply says they are empty. ( <code>$map_id</code> outputs a blank )</p> <p>The index file will still properly echo <code>$map_id</code> as 'foo', it just seems the 'Authenticate.php' file cannot access the <code>SESSION</code> varaibles.</p> <p>I have ensured <code>session_start()</code> is present in all appropriate files.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload