I have an ASP.NET website on .NET framework 4.7.2. Users get redirected to a payment gateway and once the payment has completed they’re redirected back to our site using a URL that’s provided to the payment gateway. Upon returning, sometimes the session will just disappear and a new one gets created, meaning that the transaction cannot be commited to the DB because all the data has been lost.
There are plenty of questions on this subject online and most of the fixes involve setting the session cookie SameSite value to ‘none’ and the Secure value to true, which I did shortly after SameSite=none became available and was actually a while before I began using the payment gateway. However, the issue still exists. The really frustrating thing is that it appears to be totally random when the problem does occur, and also that I have never been able to replicate it.
Does anyone have any other suggestions on how to fix this or what I can check for as it’s driving me mad!