We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

session destroy problem

my code is

  • $this->session->set('aaa', 'aaa');
  • $this->session->destroy();
  • $logger = new File(WEB_PATH."/../apps/logs/test.log");
  • $logger->error((int)$this->session->has('aaa'));
  • $logger->close();

the result is 1. why?



33.8k

Do var_dump($this->session), so you can see what's happening inside.



6.7k

The "_started" property change to false?So I can't use $this->session->has to confirm the session when I use forward after destroy session ?

Do var_dump($this->session), so you can see what's happening inside.



33.8k

Do var_dump($this->session->get("aaa")).



6.7k

After destroy, the value is "aaa", I think the destroy method doesn't do the real destroy, It still can be read untill the request is done, but this is illogical.

Do var_dump($this->session->get("aaa")).



33.8k

@phalcon will explain us better (I'm also curious).