Reputation: 1090
I have googled this extensively and am still not sure I fully understand the answer.
Is it possible to retain $_SESSION
variables throughout several calls of a .php file from the same server into an iframe? The .php file gets called by way of POST form submission and gets opened inside an iframe.
The .php file ALSO needs to share the same $_SESSION variables.
The general idea is this - unless a user is logged in ($_SESSION['userLoggedIn']
and $_SESSION['userName']
, the user should neither see the interface HTML, nor the .php file in the iframe.
Right now, as soon as I post the form into the php file in the iframe, the session is lost. And so I get the authorization login inside the iframe.
2 questions:
Upvotes: 0
Views: 837
Reputation: 2471
Yes it can be worked within iframes if they're within the same domain. Make sure you do a session_start()
on the iframe
pages.
Upvotes: 1