Payment Module - Redirects to Login

I’m developing a payment module for CS-Cart, and everything appears to be working perfectly, except for one small glitch. The credit card details are taken on our processing gateway’s server, and it’s then redirected back to our cart upon successful completion of the transaction. Some data is being passed in a querystring, and some is in an HTTP post. The page:



{$customer_index}?{$target_name}=payment_notification&{$mode_name}=notify&payment=our_processor&order_id={$order_id}



Is called, and I’m using a print_r($_POST) to dump out all of the post data, all variables are as they should be. This page in turn calls:



index.php?target=orders&mode=details&order_id=65&confirmation=Y&csid=1c3b01902bc57e9d3c4a6517f37af111&sl=EN¤cy=usd



However, instead of going straight to the appropriate page, the customer is then required to login again. After logging in again, the customer is taken to the order confirmation screen, where the order is flagged as processed, as expected. However, the items still remain in the cart.



Before I was using a post to pass back data from our processor, the additional login was not required, and the cart was emptied.



Does anyone know why this might be happening, or how to resolve it?



Thanks in advance for any advice.