Destroying sessions with CakePHP
I'm working with CakePHP 1.3. Presently I'm doing e-commerce application,there I have integrated paypal NVP API, where I can do online transaction through express checkout.
Express checkout part is working fine, but session is not getting destroying even after logout. It is storing p开发者_开发百科revious data. Please help me how to destroy session data. Here is my code for logout method.
function logout()
{
$this->Session->destroy();
$this->redirect('index');
}
I tried with Session->delete();
also but its not working.
Try:
$this->redirect($this->Auth->logout());
or:
$this->Session->delete('Auth');
This is, of course, if you are using the Auth component.
I've always used
$this->redirect($this->Auth->logout());
Of course that's only if you are using the Auth feature of cakePHP. Otherwise there must be some data somewhere printing out before the logout, turn debug to "2" and see if any errors popup as the destroy method should work fine. If you already have it to 2, is there any errors displaying?
精彩评论