Is it necessary to use session_start() and session_register() to input values for a session in PHP?

To input values for a session in PHP, it is not necessary to use `session_register()` as it is deprecated. Instead, you can directly set values to the `$_SESSION` superglobal array. However, it is necessary to start the session using `session_start()` before setting or accessing session variables.

<?php
session_start();

$_SESSION['username'] = 'JohnDoe';
$_SESSION['email'] = 'johndoe@example.com';
?>