CodeIgniter Forums

Full Version: p3p policy
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]egoslip[/eluser]
Hey guys after reading around it seems that the CI session lib is not frameset(iframe) compatible for storing sessions or cookies off the bat

I tried to add the following in the controller right before the view is called
Code:
header('P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
or
Code:
header("p3p: CP=\"CAO PSA OUR\"");

even tried both but it still not working .. i have sessions autoloading

the question is... where can add that before anything is called ... globally I mean. even with sessions autoloading

so i don't have to call it in every controller or views and it add the header info before the session is called ... as i think this is my issue the session starts before the header with the p3p is called and when the session is called it starts a new sess_id instead of continuing the old one

El Forum

[eluser]davidbehler[/eluser]
You can either put that in your index.php or create a hook: http://ellislab.com/codeigniter/user-gui...hooks.html ... pre_controller or pre_system should be what you need.

El Forum

[eluser]egoslip[/eluser]
Awesome it works great i just added it to the index file thanks

El Forum

[eluser]adinin[/eluser]
Confirming that the longer version of egoslip's header call at the top of my main index.php file (immediately after the opening php tag) solved this cookie sessions issue in an iFrame for me as well.

El Forum

[eluser]Unknown[/eluser]
I use ver. 2.1.1 and I have the same issue but headers didn't work for me. In iframe I load the page and session data than at the first ajax request i can't get read session data but after one refresh everthings cool. How odd is that!

I don't use underscores in cookiename. I have proper timezone settings. I have the headers so i don't know what else should I do ?!