I use a content management system called liferay that lets you add iframes to a page very easily. I have various different iframes that i want to use the same php session variables. This wouldn’t be an issue if the main webpage was setting the sessions. the problem is the sessions are created in one iframe and I’m wanting to use them in another?
Normally the session id could be passed via the url but that’s not how I have it set up. There is no navigation like that. the iframes display content from a database based on the session variables set up in the first iframe, but they are not linked.
Can someone help me out here? I’m not sure how else iframes can share session variables.
Thanks,
Jonesy
If the domain remains the same, the first iframe will create the session and the second iframe will just pick it up after
session_start()You dont really need to pass the session in the URL for this or anything. The first iframe while writing the session data will lock the session data. However there is a problem, with iframes you can never be sure that the first iframe does load first, maybe cause of network congestion or something it is possible that the second iframe loads first. So maybe to counter this delay loading the second iframe a bit.