When customers placed an order, the link /checkout/completed/id remains valid forever, so customer can always open the page (logged in, of course) or refresh any time he wants, causing a lot of problems on google analitycs for example.
This problem occurs more frequently on mobile devices, because customers always leave this page opened and close the navigtion app. When it is open again, reload the page and another analytics transaction or whatever is processed twice.
Here we added a time validation on this line:
public ActionResult Completed(int? orderId)
...
if (order == null || order.Deleted || _workContext.CurrentCustomer.Id != order.CustomerId || order.CreatedOnUtc.AddMinutes(5) < DateTime.Now)
This fix this issue and customer will never open the link again, after 5 minutes.
Thanks!