Thanks for the reply. I have two sites and the first works without any changes.
The first site works with the original confirm.php code and the second was working pre and post coupon code and now the second kicks you back to the cart.php page rather than the successful transaction page. The first site has the change to line 970 as above and works correctly however with your tip on line 1030 the second site started to work correctly albeit it now it reverts back to the cart.php page. I didn't make the change to line 1030 on the first site as it was working. I change the second site back to the original code and variations to lines 970 and 1030 without success.
Can you explain further about the session cookies please? The only changes after that I have made are general look and feel changes to the home page.
Any other ideas?