简体   繁体   English

ASP.Net Webforms 应用程序在访问支付网关后注销

[英]ASP.Net Webforms application logging out after visiting Payment Gateway

I am adding some features to an existing webforms application written in c# using .net framework 4.6.我正在使用 .net 框架 4.6 向用 c# 编写的现有 Web 表单应用程序添加一些功能。 After redirecting to an external payment gateway, the site returns but the user ends up being logged out so the transaction does not complete.重定向到外部支付网关后,网站返回,但用户最终被注销,因此交易未完成。

The application uses a payment gateway to make credit card payments.该应用程序使用支付网关进行信用卡支付。 Once the process starts, the applications redirects to payment gateway's site for a few seconds then returns to our checkout page.一旦流程开始,应用程序将重定向到支付网关的站点几秒钟,然后返回到我们的结帐页面。 However the user is logged when the page returns.但是,当页面返回时,用户会被记录。 As a result the process does not complete结果该过程没有完成

The session cookie is set to same site lax and secure. session cookie 设置为同一站点松散且安全。

I am using visual studio 2017 and working on my dev machine.The only thing I can think of so far is that session information is cleared whenever my application redirects to the payment gateway.我正在使用 Visual Studio 2017 并在我的开发机器上工作。到目前为止,我唯一能想到的是,只要我的应用程序重定向到支付网关,就会清除 session 信息。 So when it returns the user is no longer logged in. However, I do not know what to do to keep the session logged in.因此,当它返回时,用户不再登录。但是,我不知道该怎么做才能使 session 保持登录状态。

Any assistance would be appreciated任何援助将不胜感激

Seeing that I was working in Visual Studio 2017, when I ran the application, I was running with a URL of localhost:port_number eg'https://localhost:44390'.看到我在 Visual Studio 2017 中工作,当我运行应用程序时,我运行的是 localhost:port_number 的 URL,例如'https://localhost:44390'。 However, the url of the live site is something like 'https://www.specific.url.com'.但是,实时站点的 url 类似于“https://www.specific.url.com”。

The actual url was stored in the database and was being retrieved whenever the payment process was executed.实际的 url 存储在数据库中,并在执行支付流程时被检索。 This actual url was also being sent to the payment gateway as the return url.这个实际的 url 也作为返回 url 发送到支付网关。 Upon return the live url: 'https://www.specific.url.com' did not match the dev url: https://localhost:44390. Upon return the live url: 'https://www.specific.url.com' did not match the dev url: https://localhost:44390. This somehow caused the session info to be lost.这不知何故导致 session 信息丢失。

Once I changed the url in the database to https://localhost:44390, everything started working as expected.一旦我将数据库中的 url 更改为 https://localhost:44390,一切都开始按预期工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM