At the moment on successful paypal payment I pass a url with a paramater such as:
mysite.com/membership.php?c=h7Y6734da
I have some code that searches for code then updates a membership field in the database.
if($_GET['c'] == 'h7Y6734da')
{
$sqlInsert = ("UPDATE Customer SET Membership_Status = 1 WHERE Id = :user");
$preparedStatement = $db->prepare($sqlInsert);
$preparedStatement->execute(array(':user' => $userid));
}
The customer would have been at the page mysite.com/membership.php (where their Id is stored in the session) before clicking the payment button.
My database is not updating and I am not sure why, I believe when being send back to the page from paypal the session is being lost but I am not sure what else I can do.