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

How do I reset persisted data in memory without restarting my machine

I found that if I did something like this...

$this->persistent->acl = NULL;

... then I found I could cause an unrecoverable error.

The error then persists. I thought I might be able to break the persistence and recover by restarting apache but this didn't work.

The only way I knew besides possibly restarting my machine was to do the following:

$this->persistent->acl = new Phalcon\Acl\Adapter\Memory();
unset($this->persistent->acl);

This then opens a path to setup my Access Control List.

My question is without using code how can I reset persistent variables in phalcon bad examples aside?



125.8k
Accepted
answer

Without using code? You can't.

I believe the persistence is stored in $_SESSION by default, so visiting a page that calls session_destroy() might work.



47.7k

Thanks had a look and there it is.

Killed it using:

    $this->session->destroy();


47.7k

Also I have used:

    unset($this->persistent->acl);

but I think $this->session->destroy(); is the right way to do it.