PHP Sessions

Hi All

I don’t know a massive amount about sessions but I know a bit to get by.

I have a CMS shopping cart and it stores all the sales information in a session.

Currently you shop, check out, go to PayPal and then when you return to the website the database gets updated with the sale using a couple of functions and the session information.

This doesn’t work very well because if the person does not return to the website the sale information is lost.

I am setting up the PayPal IPN option. This means that the PayPal server talks to a file on my server and if the transaction is successful I can perform whatever functions I want.

I have all the PayPal stuff and everything working correctly except the database updating function.

Therefore my question is…

if I have everything stored in a session on the website and then go off to another website; PayPal; and it calls a file that is on my website (server) can I use the session information within that file?

Hope this makes sense and any help would be great.

Many Thanks


It’s been a while, but if I remember right paypal had some optional fields that you could put into the form, which get posted back with the ipn verification. While you could put the session id there, I wouldn’t. session are volatile, and unless you understand them and know how and why you need to alter the configuration, the data isn’t guaranteed to last very long. It would suck if the session data is gone after the user paid…

Store the order in the database, mark it pending. finalize it when you get the ipn postback. put the order id in the hidden form field.

Thanks; that was the send option I was considering.