MDauphinais1
asked on
Remember Sessions Within FRAMESETS
I'm having trouble with sessions being read in a frameset.
I have a site mydomain.com where the user logs in, a cookie is created and everything works great. Some of my pages are required to be launched from anotherdomain.com due to licensing regulations. So on the anotherdomain.com site I have some HTML files with FRAMESETS that include the PHP files from mydomain.com. When you launch these HTML files from the anotherdomain.com site the browser doesn't remember you logged in already. How can I fix this?
I have a site mydomain.com where the user logs in, a cookie is created and everything works great. Some of my pages are required to be launched from anotherdomain.com due to licensing regulations. So on the anotherdomain.com site I have some HTML files with FRAMESETS that include the PHP files from mydomain.com. When you launch these HTML files from the anotherdomain.com site the browser doesn't remember you logged in already. How can I fix this?
ASKER
Since I am going from my PHP site, out to an .html URL and then FRAMESETing my PHP site again, how can I pass the PHPSESSID all the way through? Is it possible to post the PHPSESSID from the original PHP file to the HTML file and then grab it from the HTML file and attach it to the FRAMESET?
<frameset>
<frame src="frame1.php?PHPSESSID= <?=session _id()?>" name="frame1">
<frame src="frame2.php?PHPSESSID= <?=session _id()?>" name="frame2">
</frameset>
<frame src="frame1.php?PHPSESSID=
<frame src="frame2.php?PHPSESSID=
</frameset>
Actually, this is better:
<frameset>
<frame src="frame1.php?<?=session _name()?>= <?=session _id()?>" name="frame1">
<frame src="frame2.php?<?=session _name()?>= <?=session _id()?>" name="frame2">
</frameset>
<frameset>
<frame src="frame1.php?<?=session
<frame src="frame2.php?<?=session
</frameset>
ASKER
Not sure how I would use that... Here's what's happening.
The main site mydomain.com has a regular link that goes to http://anotherdomain.com/folder/folder/myfolder/page.html
In the page.html file I have the FRAMESET:
<FRAMESET COLS="100%">
<FRAME SRC="http://mydomain.com/somepage.php">
</FRAMESET>
So can I somehow grab the session id on the first page, send it to the html page, and then grab it from the html page and attach it to the php file name in the FRAMESET?
First page link: "http://anotherdomain.com/folder/folder/myfolder/page.html?PHPSESSID=jBA9938FNSKSA92"
Page.html file:
get PHPSESSID;
<FRAMESET COLS="100%">
<FRAME SRC="http://mydomain.com/somepage.php?PHPSESSID=jBA9938FNSKSA92">
</FRAMESET>
I think passing the session id to the HTML file through the address bar and grabing it again like you can do with PHP is my biggest problem...
The main site mydomain.com has a regular link that goes to http://anotherdomain.com/folder/folder/myfolder/page.html
In the page.html file I have the FRAMESET:
<FRAMESET COLS="100%">
<FRAME SRC="http://mydomain.com/somepage.php">
</FRAMESET>
So can I somehow grab the session id on the first page, send it to the html page, and then grab it from the html page and attach it to the php file name in the FRAMESET?
First page link: "http://anotherdomain.com/folder/folder/myfolder/page.html?PHPSESSID=jBA9938FNSKSA92"
Page.html file:
get PHPSESSID;
<FRAMESET COLS="100%">
<FRAME SRC="http://mydomain.com/somepage.php?PHPSESSID=jBA9938FNSKSA92">
</FRAMESET>
I think passing the session id to the HTML file through the address bar and grabing it again like you can do with PHP is my biggest problem...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect! Thank you.
Glad I could help.
By the nature of cookies, you will not see cookies for anotherdomain.tld when your domain is mydomain.tld