views:

310

answers:

4

I am building a website that is loaded into a frameset by other sites (where the domain names are different for the parent site).

This works fine in all browsers (including IE6), except for IE7. It is not registering the session at all and simply does not work.

Site is implemented using LAMP, MySQL 5, and PHP 5 - yeah, probably not relevant to the actual problem but still worth mentioning.

Any suggestions?

+4  A: 

That's a standard Internet Explorer security setting. It won't accept "third-party cookies" (i.e., cookies from a domain other than what's showing in the address bar). Among other uses, this prevents advertisers from saving tracking cookies for their ads displayed on other sites.

Individual visitors can turn off that setting in their preferences, but you won't be able to skirt around it at your end other than to break out of the frameset.

VoteyDisciple
Also, I believe that Firefox has a similar setting.
redtuna
A: 

Has the hostname/domain name got an underscore in it (i.e. test_site.localdomain)? If so, that could be the problem as IE does some basic validation on the domain name before setting cookies (and therefore remembering the session) and it rejects underscores/underlines in the hostname.

Richy C.
+2  A: 

I think that if you add an appropriate P3P Policy then IE will allow the cookies.

I created one using the IBM P3P Policy Editor.

Greg
+4  A: 

You might want to try adding a P3P header to your site as follows:

header('P3P: CP="ALL ADM DEV PSAi COM OUR OTRo STP IND ONL"');

See this blog post for details.

Paul Dixon