CakePHP 2.0 Session->destroy() doesn't destroy data

Hey guys, in my controller, I have the following method:


login(){
   $this->Session->write('role', 'admin');
}

logout(){
   $this->Session->destroy();
}

Apparently, I can still read the session data, $this->Session->('role'), after destroying it. Anyone can help?

Much is appreciated...

Asked by xbfish, on 7/1/12

1 Answer

Hi

Try: $this->Session->delete('role');

destroy doesn't delete data, maybe a bug..

Answered by harunon 15/2/12

Thanks Harun. I also did a manuanl delete to get rid of the session data.

xbfish - on 15/2/12

<< comments | comments >>
<< previous next >>

Rating

0

Viewed

564 times

Last Activity

on 15/2/12