I see from the CakePHP 3.2 documentation that to configure a session I need to use write(), so I tried that in my controller like this:
use App\Controller\AppController;
use Cake\Core\Configure;
class RatingsController extends AppController
{
public function initialize()
{
parent::initialize();
$this->loadComponent('RequestHandler');
$this->loadComponent('Paginator');
Configure::write('Session', ['defaults' => 'php']);
}
}
But this doesn't seem to set up a $_SESSION array if executed in my controller.
I thought I had a workaround by setting up Auth, and thereby was able to access $_SESSION, but then when I open the controller by adding $this->Auth->allow(); to the init above, the session variable no longer exists.
Where do I need to configure Cake to start a session?
$_SESSIONin the first place? You shouldn't access any superglobals directly when using CakePHP! - ndm$_SESSIONdirectly (not why you want to use sessions at all), as this is what your questions sounds like as it stands. - ndm