【发布时间】:2020-12-26 03:43:19
【问题描述】:
我们的一些客户遇到了一种奇怪的情况,他们丢失了会话数据。这总是在从我们的支付服务提供商 ogone 重定向之后发生。流程如下:
-
用户正在完成订单
-
用户决定通过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";
}
访客跳转到外部页面设置短信支付验证码然后 第二步,确认付款
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/ThreeDModelProvisionGate'); //Baglanacagi URL
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIE, session_name() . '=' . session_id());
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
$xxxml = new SimpleXMLElement($data);
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
切换到第二步时,会话数据丢失
你能帮忙吗
请注意,某些用户有时不会永久出现此问题
【问题讨论】:
-
您能确认一下您的 CI 版本吗?报告了早期 3.x 版本的一些会话问题
-
ci-version = 3.1.11
标签: php curl codeigniter-3 libcurl php-curl