09-15-2018, 11:36 AM
Sorry if this seems like a stupid question, but I'm not actually playing with CI4, so I can't dig through code, debug, and figure things out on my own.
From the docs:
The part that I'm concerned with is "should be". If the session is already initialized, would calling session() a second time mess things up?
In CI3 I could do this:
But in CI4, since session() takes a config param, do I worry about calling session() a second time and creating a conflict? How would I know that $session is initialized?
From the docs:
Quote:Sessions will typically run globally with each page load, so the Session class should be magically initialized.
The part that I'm concerned with is "should be". If the session is already initialized, would calling session() a second time mess things up?
PHP Code:
$session = \Config\Services::session();
In CI3 I could do this:
PHP Code:
if( ! $this->load->is_loaded('session') )
$this->load->library('session');
But in CI4, since session() takes a config param, do I worry about calling session() a second time and creating a conflict? How would I know that $session is initialized?