I have update into my project the last version of cakephp core. Now I get this error:
Deprecated (16384): SessionHelper has been deprecated. Use request->session() instead. [CORE/src/View/Helper/sessionHelper.php, line 39]
The error I think is in this line:
if ($this->session->read('admin_logged_in')){
What should I use instead?
Thanks
raph
if ($this->request->session->read('admin_logged_in')){
should be fine.
UPDATE
As per the comment of @raph below the correct answer is
$this->request->session()->read('admin_logged_in')
Note the () after session
In Cakehp 3.7, use getSession() instead.
$this->request->getSession()->read('admin_logged_in');
Ref: https://book.cakephp.org/3.0/en/development/sessions.html
来源:https://stackoverflow.com/questions/32668754/cakephp3-session-deprecated