(09-21-2018, 06:10 AM)sv3tli0 Wrote: "global variable" is not in OOP style.. Usually when you want something you load it somehow.
This will only guarantee that session is started ..
From that point to set/get things in the session is up to you. $_SESSION is available to get it and in the few places where you will set something you can simple get the same
Code:
$session = \Config\Services::Session();
Yes I understand and that's now what I want (to make that available global)
The aim is
To start session for all pages
To connect to database - required for all pages
At the moment, I can do that above fine by creating a base controller and extending to it.