Page 1 of 1

PHP session lost after returning from paypal

Posted: Fri Jun 18, 2004 11:50 pm
by paladaxar
here's the problem...I am using PayPal's IPN (instant payment notification) on my website to tell my server that the customer has paid for an item. When using IPN, a form with a nice "PayPal" button at the bottom of it takes the user to the Paypal.com to pay for the item (so that i dotn have to deal with credit cards). The form has a few variables that can be set (i.e. cost of item, number of items, etc.). One of the form items is a return-to site location. I have that set to a page that says something like "thank you customer for paying." (where cutomer is replaced by "echo $customer_name;") On that page my database is also updated to let me know that the customer has paid. Well, (when testing my site) the first time I pay for an item, go through paypal and return to my site, the session has been lost. The return page says "thank you for paying." It doesnt have the customer's name (or any other variables for that matter) becuase the session is gone. Then, if i keep that window open and click my "home" button, log in again and go through the same steps (buy an item, go to paypal to pay for it, and return to my site), it magically works! The session is still active, the customer is still logged in, the variables are accessable, and the database is updated! I AM STUMPED!!! If it didnt work at all, that would be one thing, and i would assume that sessions are destroyed once you leave the site (and go to paypal or any other site), but it always works the second time. Like i said....im stumped.