How can the use of $_SESSION['user1'] instead of session_register() improve the efficiency and security of PHP scripts?

Using $_SESSION['user1'] instead of session_register() improves efficiency and security in PHP scripts by avoiding deprecated functions like session_register() which can lead to vulnerabilities. Directly assigning values to $_SESSION['user1'] is a more modern and secure way to store session variables.

<?php
session_start();

$_SESSION['user1'] = "JohnDoe";
?>