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

Persistent data cannot been deleted?

I wrote some code to save user search conditions, and I use persistent service, but I got a big problem, because the persistent data cannot been deleted:

unset($this->persistent->conditions);
$conditions = $this->persistent->conditions;
var_dump($conditions);die();

Conditions output again, also not work using: $this->persistent->remove('conditions') Why did this happen?



34.6k
Accepted
answer

You have to use:

$this->persistent->destroy();