$_SESSION, PHP, iframe, not getting the SESSION variables
Make sure that session_start()
is on all the pages:
session_start() creates a session or resumes the current one based on a session identifier passed via a GET or POST request, or passed via a cookie.
see PHP manual reference
To control the contents of the $_SESSION try to put in all ifreame pages the code:
<?php
session_start();
echo '<pre>';
var_dump($_SESSION);
echo '</pre>';
How to transfer php session variables from a page to an iframe inside the page
What ever page is referenced in the iframe, if it exists on your the same domain will have access to the same session information on the hosting site so long as that page has session_start() called on it.
Example.
page1.php
<?php
session_start();
$_SESSION["HELLO"] = "WORLD";
?>
<html>
<iframe src='page2.php'/>
</html>
page2.php
<?php
session_start();
echo "HELLO ".$_SESSION["HELLO"]; // will output HELLO WORLD
This is only true for sites that have access to the same cookies and the same session store.
Related Topics
How to Get Jquery Code Completion in Netbeans
How to Get Random Image from Directory Using PHP
How to Redirect a 404 Error in a Custom 404 Page Using Codeigniter
PHP Send Email with Attachment
How to Access Static Member of a Class
How to Strip Out the Domain Name from a Url in PHP
Yii2 Require All Controller and Action to Login
How to Create Thumbnails or Preview for Videos
How to Import Xml String in a PHP Domdocument
How to Check If a Value Already Exists to Avoid Duplicates
Find Multiples of a Number in PHP
PHP - Cannot Use a Scalar as an Array Warning
Accessing a Variable Defined in a Parent Function
How to Force Page Not to Be Cached in PHP
Php/Gd - Transparent Background