php session is started code example
Example 1: php start session if not started
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
Example 2: php start a session
session_start();
if(!isset($_SESSION["started"]){ //Check if the session already exist
//If it does not exist we append attributes we need in
$_SESSION["started"] = true;
$_SESSION["attribute_1"] = $value_1;
...
$_SESSION["attribute_n"] = $value_n;
}