When using Session in CakePHP 3.6.4 it does not read the session data created on other pages, but on the same page it shows the value.
echo $this->request->getSession()->write('Ref.url', 'valor2');
echo 'Ref: '.$this->request->getSession()->read('Ref.url');
I'm using this way, inside the controller, it works and shows the data on the same page, but when I use the "read" on another page, no content is displayed. As if something was destroying the session. How do I resolve this?
I'm using the built-in php 7.2.5 Server.