What are the advantages of including pages directly after session start in PHP?

Including pages directly after session start in PHP can help improve performance by reducing the number of unnecessary requests to the server. It can also ensure that any necessary session variables or configurations are set before the page content is loaded, preventing potential errors or inconsistencies in the application.

<?php
session_start();

// Include necessary files or execute specific code here
include 'header.php';

// Rest of the page content
?>