How can the use of session_register() be improved in the login-script code for better performance?

The use of session_register() function is deprecated and can lead to security vulnerabilities. To improve performance and security, it is recommended to directly assign values to $_SESSION superglobal array instead of using session_register(). This will eliminate the need for the function call and ensure that session variables are properly set.

// Instead of using session_register(), directly assign values to $_SESSION superglobal
$_SESSION['username'] = $username;
$_SESSION['logged_in'] = true;