Within my app I find that I am constantly seeing errors/warnings regarding sessions and I'm not sure why.
It's the standard "<b>Notice</b>: A session had already been started - ignoring session_start() in <b>app\config\services.php</b> on line <b>144</b><br />"
style message
and the session service is registered as follows
/**
-
Start the session the first time some component request the session service */ $di->set('session', function() {
$session = new SessionAdapter(); $session->start();
return $session; },true);
It's the same whether or not I set session to be shared (true) or not. The warning here is being generated when I use $this->security->getToken() in a view to generate csrf token but I've seen other instances usually happening when one of my views contains a call to content()
Does anyone know why this would be and how I can stop it from happening? Normally I'd use output buffering to suppress these errors but I'm not sure what's going on here
thanks