从付款提供商代码点火器重定向后,会话丢失了

问题描述

我们的一些客户遇到了一种奇怪的情况,即他们失去了会话数据。这总是发生在我们的付款特权者ogone重新定向之后。流程如下:

在调试此问题时,我发现当用户从ogone重定向到应用程序时,会话数据会丢失。仅在x数量的请求上发生一次。因此,当我在任何可能的浏览器中测试代码时,它似乎都可以正常工作。我没有找到付款失败与浏览器/付款方式/ ...之间的链接

这是我的会话配置:

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 172800;//48 hours
$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = false;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

第一步是与银行确认卡

 try {
        $ch = curl_init();
                curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
                curl_setopt($ch,CURLOPT_HTTPHEADER,array('Content-type: application/xml','Content-length: ' . strlen($xml)));
                curl_setopt($ch,CURLOPT_POST,true); 
                curl_setopt($ch,CURLOPT_HEADER,false); 
                 curl_setopt($ch,CURLOPT_URL,'https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home/ThreeDModelPayGate'); 
                
                curl_setopt($ch,CURLOPT_POSTFIELDS,$xml);
                curl_setopt($ch,CURLOPT_COOKIESESSION,true);
               
                curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); 
                
                 curl_setopt($ch,CURLOPT_COOKIE,session_name() . '=' . session_id());
                $data = curl_exec($ch);
                curl_close($ch);
            } catch (Exception $e) {
                echo 'Caught exception: ',$e->getMessage(),"\n";
            }

将访问者转移到外部页面以设置SMS付款验证码,然后 第二步是确认付款

 try {
                    
                    $ch = curl_init();
                    curl_setopt($ch,false);
                    curl_setopt($ch,'Content-length: ' . strlen($xml)));
                    curl_setopt($ch,true); 
                    curl_setopt($ch,false); 
                  
                    curl_setopt($ch,'https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home/ThreeDModelProvisionGate'); //Baglanacagi URL
                    curl_setopt($ch,$xml);
                  
                    curl_setopt($ch,true);
                   curl_setopt($ch,session_name() . '=' . session_id());

              

                curl_setopt($ch,true); 
                $data = curl_exec($ch);
                curl_close($ch);
                
                $xxxml = new SimpleXMLElement($data);
            } catch (Exception $e) {
                echo 'Caught exception: ',"\n";
            }

切换到第二步时,会话数据会丢失

您能帮忙吗

请注意,某些用户有时不会永久出现此问题

解决方法

header('Set-Cookie:'。session_name()。'='。session_id()。'; SameSite = None; Secure');