Fixing IE7 dropping PHP Sessions

Posted on March 25th, 2008 in OpenSocial, PHP, Geek Stuff by jason

after banging my head against the wall, and spending the better part of today trying to find out why my session variables were not being transferred from page to page in IE7, it worked fine in FF and opera, and the same script worked for years in IE6. The sessions not working were rendering my opensocial apps dead to anyone using IE7. But the good news is i got it fixed, and the fix is so simple it’s ridiculous.  Before you start your session, you need to declare a privacy policy in your header.

so

1
2
ob_start(); 
session_start();

now becomes

1
2
3
header('P3P: CP="CAO PSA OUR"'); 
ob_start(); 
session_start();

and everything works now……hope someone gets some use out of it…….

Post a comment

You must be logged in to post a comment.