How to start session globally? |
I looked at the documentation, https://bcit-ci.github.io/CodeIgniter4/l...-a-session, which says,
Code: To access and initialize the session: Am I supposed to put this code in the constructor of every Controller class where I need to manipulate session data? I found that I can also use start session using this helper Code: session()->start(); I need to know the same for db and custom common functions helper file. $db = \Config\Database::connect(); All I am trying to find out if I should be placing these in a common file? Or perhaps, declaring in each file is the suggested practice??? |
Welcome Guest, Not a member yet? Register Sign In |