问题
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 .
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.
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.
回答1:
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.
来源:https://stackoverflow.com/questions/39755885/losing-user-cookies-and-session-data-after-being-redirected-from-payment-gateway