Thanks for that. As a followup, if i have pages like this
index.php
page1.php
page2.php
page3.php
page4.php
and i want to control access to all of them using sessions, do i have to put session start on each page?
Or is it enough if i have a php script that acts as a controller and loads them, to have the session start in the constructor function of that controller class?
what i mean is, if the controller class has an object that connects to the database each time the controller is accessed, could session start be declared in there instead of littering it on each page, which one may easily forget to add session start, whereas a controller script that manages all access all those pages could have it in one place.
Would a declaration in the constructor apply to all includes that load the pages?