php start session once code example
Example 1: php start session if not started
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
Example 2: session start php
<?php
// This sends a persistent cookie that lasts a day.
session_start([
'cookie_lifetime' => 86400,
]);
?>