Home Top Ad

How to delete session in cakephp 3.0?

Share:

You're looking for $this->request->session()->destroy();
Just a tip - there's not much of a point for storing a variable $session for a function that small, where the reuse of $session isn't necessary. The only case I'd store $this->request->session(); in a variable is when I'm accessing the session for multiple read and writes all in the same function.
(As far as the error is concerned, @Eagle is correct in that you're referencing '$this' twice by the use of that stored variable.)

Aucun commentaire