Javascript Chrome从支付网关返回时会丢失我的会话数据

Javascript Chrome从支付网关返回时会丢失我的会话数据,javascript,php,forms,session,payment-gateway,Javascript,Php,Forms,Session,Payment Gateway,从8月初开始,我的用户在使用Chrome与Moneris进行支付时,目前正在丢失他们的会话。它在Firefox下运行良好。代码几年来一直没有改变,都是自动启动的 支付“summary.php”页面最初调用网关URL,然后在事务完成后返回“return.php”页面。此返回页仅包含一个表单,用于获取事务密钥并将其发回网关以进行验证: <?php session_start(); ?> <!doctype html> <html lang="en&qu

从8月初开始,我的用户在使用Chrome与Moneris进行支付时,目前正在丢失他们的会话。它在Firefox下运行良好。代码几年来一直没有改变,都是自动启动的

支付“summary.php”页面最初调用网关URL,然后在事务完成后返回“return.php”页面。此返回页仅包含一个表单,用于获取事务密钥并将其发回网关以进行验证:

<?php
    session_start();
?>
<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <script>
            function verify_transaction() {
                document.getElementById('verify').submit();
            }
        </script>
    </head>
    
    <body onload="verify_transaction()">
        <form id="verify"  name="verify" action="https://www.gateway.com/verify.php" method="post">
            <input type="hidden" name="ps_store_id" value="abcdef">     
            <input type="hidden" name="hpp_key" value="abcdef">
            <input type="hidden" name="transactionKey" value="<?php echo $_POST['transactionKey'] ?>">
        </form>
    </body>
</html>

函数验证_事务(){
document.getElementById('verify').submit();
}

函数验证_事务(){
document.getElementById('verify').submit();
}

$\u POST['transactionKey']
实际上不是会话变量,而是POST请求中的一个属性,它会将用户发送到此页面。你能在你的Chrome开发者工具(网络选项卡下)中检查请求,并查看请求
return.php
的确切细节吗?同时启用错误报告。很抱歉,我错误地说帖子是会话的一部分!因此,在这种情况下,我实际上能够从网关获取transactionKey并将其发送回,但此时对用户会话的任何引用都消失了。也许您也可以在往返过程中将会话id发送到支付网关。(虽然你应该能够解决cookie问题,但你自己还没有真正开始调查这个问题)我可以在3个单独的站点上使用2个单独的支付网关完全复制Chrome。当支付网关在成功/拒绝回发后返回到站点时,就好像会话丢失一样。似乎只影响铬
<?php
session_start();
if(isset($_POST['transactionKey'])) {
    $_SESSION['transKey'] = $_POST['transactionKey']; 
}
?>

<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <script>
            function verify_transaction() {
                document.getElementById('verify').submit();
            }
        </script>
    </head>
    
    <body onload="verify_transaction()">
        <form id="verify"  name="verify" action="https://www.gateway.com/verify.php" method="post">
            <input type="hidden" name="ps_store_id" value="abcdef">     
            <input type="hidden" name="hpp_key" value="abcdef">
            <input type="hidden" name="transactionKey" value="<?php echo $_SESSION['transKey']; ?>">
        </form>
    </body>
</html>