session_start() method is in Session.php class constructor
Session.php class is required in every page header (require_once('Session.php'))
That means that Session class will be included again when I redirect to another url and every time new session will be started. This will cause errors.
But this piece of code works properly, why?
class Session {
private $signed_in = false;
public $user_id;
private $is_admin;
public $message;
public $count;
function __construct() {
session_start();
$this->visitor_count();
$this->check_the_login();
$this->check_message();
}
} //End of Session Class
$session = new Session();
Why I should start new session on every initialization of Session class