I am making a event hosting website using php as backend language.So in this site we are showing various kind of events. So when user comes to our site he/she can register on the site and after registering he/she can browse through the events of their choices. Now they can buy a ticket for any event in which they want to participate.
To make the payment process I have integrated paypal api. So when a user will click on Buy Ticket button on any event and he/she will be redirected to paypal portal to proceed for payment.
I also need to store the info in my database that whom has made successful payments for which event. But the problem I am facing is that when someone returns from paypal after making successful or may be unsuccessful payment then the session variable in which I have stored the userid, that variables becomes empty. Now if I don't know the userid who have done the transaction, then how I can store the user with the transaction to the database.
I know that on various shopping sites same kind of functionality must be implemented but I want to know how people implement this with paypal.