从付款网关重定向后,丢失用户Cookie和会话数据 [英] Losing user cookies and session data after being redirected from payment gateway

查看:483
本文介绍了从付款网关重定向后,丢失用户Cookie和会话数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将ASP.net MVC5用于我的电子商务项目.我没有使用任何SSL. 我还成功集成了支付网关.我面临的问题是,当我将数据发布到付款网关时,它会处理付款并将响应发送回我们的Web应用程序操作方法,从而使用户注销,即User.idenity设置为null.

I am using ASP.net MVC5 for my e-commerce project . I am not using any SSL . I have also successfully integrated the payment gateway. The problem i am facing is that while i am posting data to the payment gateway it process the payment and send backs the response to our web application action method the user gets logged out i.e. User.idenity sets back to null .

我认为这是由于HTTP到HTTPS连接的缘故,因为每个网关都使用https作为安全性.并重定向到https后,它将删除所有cookie和会话数据.

I think it occurs beacuse of HTTP to HTTPS connection as every gateway uses https as a security. and after getting redirected to https it removes all the cookies and session data.

但是我不想使用https连接来保留用户登录会话.从付款网关重定向回我的用户登录状态后,请告诉我.

But I don't want to use https connection in order to retain the User login session . Please tell me how to retain my user signin state after it gets redirected back from payment gateway.

推荐答案

请检查<httpCookies domain="localhost" httpOnlyCookies="false" requireSSL="false" />这样的cookie域名.效果很好.

Please check here I have faced similar issue while integrating CC avenue payment gateway. To fix the issue, I have set the cookie domain name something like this <httpCookies domain="localhost" httpOnlyCookies="false" requireSSL="false" /> with sessionstate cookieSameSite="None". This has worked perfectly.

这篇关于从付款网关重定向后,丢失用户Cookie和会话数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆