Jump to content

Session variables problem after connecting to 3rd party site


marsheng

Recommended Posts

I'm using session variables for my site. When I go to a 3rd party payment site, it does something strange to some of the code.

On top of each web page, I have a routine to check that the session is still valid. valid_session.php.  When I return from the 3rd party site, I get errors with this routine.

PHP Notice:  A session had already been started - ignoring session_start() in valid_session.php on line 4
PHP Notice:  Undefined index: HTTP_USER_AGENT in  CAMS_style.php on line 9

The line 9 is   <?php if (stristr($_SERVER['HTTP_USER_AGENT'],'mobi')== TRUE){  ?>

This CAMS_style.php is on every page but only fails when I return from the 3rd party site.

At a loss on how to go forward.

 

Link to comment
Share on other sites

this is a common symptom when a redirect changes either the http vs https protocol, the www. vs no www. host-name in the url,  or the path after the domain in the url and the session id cookie parameters are not set up to match variations in those values.

you need to insure that the the return URL you have set up in the payment gateway matches where the session was created and/or set the session id cookie parameters to match all variations in the url, rather than just the one where the session was created. these settings are covered in the php.net documentation.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.