cancel
Showing results for 
Search instead for 
Did you mean: 

Losing _SESSION and _COOKIE (PHP)

Hi,

I'm testing the basic setup where you on http://mywebsite.com/payment_method.php select CC payment and go to Auth.Net, enter CC info, submit, on thank you page click on back to mywebsite.com button and finish on mywebsite.com/thankyou.php. It works.

Though, my $_COOKIE and $_SESSION, created before visiting Auth,Net cc form, is dissapeared. New session ID has been created.

 

What am I doing wrong?

 

I need "old" session values to store submitted data to mysql as well as to continue with 2nd part of the order.

 

Thanks for any help,

Afan

apasalic
Contributor
1 REPLY 1

There are a variety of reasons why that could be happening. For instance, if the Authorize.net payment form is in a new window. the new window may not be carrying over the cookies from the previous window, Windows is odd that way.

 

What you probably need to do is pass your session ID as a custom field, then use that to reload the session once you're done submitting payment. Short of that, you need to create the payment record in your database at the start, pass the record ID, and just update it to mark as "paid" at the end. You can't necessarily rely on sessions to stay around forever.

TJPride
Expert