I provide some content that another web site loads up in a frame. I have set session.autostart to true in my php.ini file so that sessions are always started automatically and use cookies. The problem is that when a user clicks on any links in my first page a new session is started, the current one is not used.
I try and set some session vars using the following on my first page:
<?php $_SESSION["a"] = "a"; $_SESSION["b"] = "b";
echo "<a href='index.html'>Click Here</a>"; ?>
After this page loads in a frame I look at the /tmp dir on my server and I can see that a session file has been created and contains the correct values.
However if I click the link (which is just a link to the same page), a new session is started. I.e. if I look in /tmp I now see 2 session files and the newer one is empty. If I reclick on the link the new session is used and the the session vars are properly set.
The problem is that the first session that is created is not used. clicking on links in my frame (which go to other pages on my server) causes a new session to be started and the original session to be forgotten. The second session is then correctly kept across pages.
Why is my first session not kept? I'm a bit confused. Could it have anything to do with the fact that the site that is using my content is also setting a cookie?
Thanks,
Jean-Christian Imbeault
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php