Friday, January 25, 2013

maintaining session after redirect from payment (credit card) post

I was facing this exact problem in CakePHP, the answer was to use Security.low in core.php !:


Hey Guys,
Let me write down the steps to reproduce my problem:
Reproduce steps:
1. Customer login my site(;
2. Choose a product and redirect to Paypal sandbox site( to complete the payment;
3. After the payment, the customer will be auto redirected to my site;
4. And then the customer session was lost.

I find the solution in Paypal forums, said that :

You could pass your "session variable" Through PayPal variable "custom" than read it back in when the buyer is returned to your site after completing the PayPal payment or through the IPN POST.
You could also use an authentication cookie which would stick around while the customer made a payment on PayPal's website and when they returned to your site they would still be authorized.
I try to store the session in my post form and get it after the redirect from paypal site.
And then I use $this->Session->id($lastSessionID) to restore it. But fail as before.

Is there anybody has the idea how to implement it in Cake App?
Appreciate for any reply from you.


thanks indeed