3

I have a form and payment gateway that I use for a business site. For the payment to be processed, information is sent to my merchant provider's gateway URL (off my site/server) and then redirected back to my site. To a receipt page if you will.

Well, on all my other browsers that I've tested so far (IE6–9, FF, Chrome), everything works beautifully. With Safari, all the session variables come back empty.

I've tested the session ID itself and it is the same throughout the site and never changes. Even when I get back to the receipt page, it stays the same. What I have at the very start of the page is this:

    header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');
    session_start();

I found somewhere that said that the header() call could fix the problem but it doesn't! Do you have any suggestions on how to fix this little problem? I'm totally stumped.

hakre
  • 193,403
  • 52
  • 435
  • 836
djdgel
  • 61
  • 1
  • 4
  • 2
    Have you tried checking your Safari to see if it is able to accept a cookie? What happens if you attempt to set the session identifier via the URL? Does that still work? – F21 Nov 27 '11 at 08:34
  • Please see http://stackoverflow.com/q/486569/367456 – hakre Nov 27 '11 at 08:57
  • possible duplicate of [PHP session is null when called in other page in safari](http://stackoverflow.com/questions/2733841/php-session-is-null-when-called-in-other-page-in-safari) – hakre Nov 27 '11 at 08:57
  • 1
    Thanks for the responses. I am aware of the Safari issue, hence the post lol. I've already tried the solution from [link](stackoverflow.com/q/486569/367456) Thats where i got my header line from actually :). But no luck so far. I've changed my Safari to never block cookies. I can put the session Id in the URL and pull it from there but the session variables still come back blank. The problem with having Safari never block cookies is that my visitors most likely will not have that setting =/ – djdgel Nov 27 '11 at 16:57
  • If the session is still lost when you use URI query-info parameters, double check that PHP allows that. As well double check which cookies are send (`$_COOKIES`). If the session-id is send but `$_SESSION` is empty and you've verified that you've set it for the sessionid, there must be some other problem in your code/configuration. You need to debug this, e.g. check if cookies are send or not. – hakre Nov 28 '11 at 11:56

1 Answers1

1

Even I had same issue, The following header in before starting Session works well for IE also

<?php
    // sort out ie with the below header
    header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
    session_start();
    $_SESSION = array();
Bhavesh B
  • 1,121
  • 12
  • 25