What are best practices for adding new data to an existing session array in PHP?

When adding new data to an existing session array in PHP, it's important to first check if the session has been started and then simply assign the new data to the session array using the appropriate key. This ensures that the new data is added to the existing session array without overwriting any existing data.

// Check if session has been started
if(session_status() == PHP_SESSION_NONE){
    session_start();
}

// Add new data to existing session array
$_SESSION['new_data_key'] = 'new_data_value';