I just got done reading a bunch of threads on this topic after using the search on this site, however my problem still exists.
I'm having problems transferring session information from a secure site (www.mysecuredomain.com) to a non-secure site (www.mynonsecuredomain.com). These scripts are both on different domains which means I have to transfer the session id in the URL and/or a hidden form variable.
I wrote a simple script to test this which initializes a session and sets a single session variable called "username" equal to "testUser".
<?
session_start(); $_SESSION['username'] = "testUser"; header("location: [url]http://www.mynonsecuredomain.com/testsess2.php?sess=[/url]" . session_id());
?>
The script on the non-secure site looks like this...
<?
if($GET['sess'])
{
$session = $GET['sess'];
session_id($session);
}
session_start();
?>
<html>
<body>
<?
echo $_SESSION['username'] . "<br>";
echo session_id();
?>
</body>
</html>
The session id is pulled from the URL and set just fine, however no username is printed out on testsess2.php. This tells me that none of the session data got transferred.
Does anyone have any idea why this is happening and what can I do to fix it? Thanks for the help.
- Brad