marsheng Posted August 14, 2018 Share Posted August 14, 2018 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. Quote Link to comment https://forums.phpfreaks.com/topic/307610-session-variables-problem-after-connecting-to-3rd-party-site/ Share on other sites More sharing options...
fatkatie Posted August 14, 2018 Share Posted August 14, 2018 It's probably not defined. Test for it first. Quote Link to comment https://forums.phpfreaks.com/topic/307610-session-variables-problem-after-connecting-to-3rd-party-site/#findComment-1560350 Share on other sites More sharing options...
mac_gyver Posted August 14, 2018 Share Posted August 14, 2018 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. Quote Link to comment https://forums.phpfreaks.com/topic/307610-session-variables-problem-after-connecting-to-3rd-party-site/#findComment-1560351 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.