What are the potential security risks associated with using session_register() in PHP?

Using session_register() in PHP can potentially lead to security risks such as register_globals being enabled, which can allow attackers to manipulate global variables and potentially inject malicious code into the application. To mitigate this risk, it is recommended to use the $_SESSION superglobal array directly to register session variables.

// Instead of using session_register(), directly assign values to $_SESSION
$_SESSION['variable_name'] = $value;