views:

207

answers:

1

Is it possible to pass a SESSION variable from am embedded IFRAME to the parent page?

Meaning:

<form>

<iframe>
upload image to fake AJAX.
With PHP, set $_SESSION to be the location of the temporary uploaded photo
</iframe>

<input type="submit" />  // will this form submit have the $_SESSION variable set from the IFRAME?

</form>
A: 

PHP sessions are, by default, implemented using cookies (which are per-domain).

You don't need to do anything explicit to share them between different frames (except keep them on the same domain).

David Dorward
So, what you're saying is that this will work. Is there any Security concerns I should be aware of?
JohnJon
Nothing beyond the usual ones.
David Dorward