0

I've created a website in which user add his stuff and publish it. After publish my website generates a script which user should copy in his/her website. That code first make a cross-domain ajax request with jsonp. If everything works fine then an iframe gets created by my script and a session with that user's id is created and using that session value i fetch that user's data. This works completely fine in chrome and firefox. But not in IE or Safari.

I tried to print_r($_SESSION) on the page. In chrome and firefox i can see the vaue of my session but in IE and safari it displays Array().

I cannot understand what is the problem. Please tell me what should i do.

My IE version is 11.0 and safari's version is 5.1.7 for windows.

Vidhyut Pandya
  • 1,605
  • 1
  • 14
  • 27
  • You need to post your code, do you expect us to use telepathy to figure out what you're doing wrong? – Barmar Jul 24 '15 at 06:36
  • @Barmar What code i add. I simply put `$_SESSION['customer_id'] = $result['customer_id']` to set session so i did't mentioned my code. – Vidhyut Pandya Jul 24 '15 at 06:44
  • Do you call `session_start()`? Do you make sure that there's no output before doing this? Check the PHP error log for the warning "Headers already sent". – Barmar Jul 24 '15 at 06:48

1 Answers1

1

You need to include this header in your PHP file which is used for cross-domain request.

header('P3P: CP="CAO PSA OUR"');

For further explanation, please check this link

Community
  • 1
  • 1
Raja Amer Khan
  • 1,489
  • 10
  • 31