What is the potential issue with using session_register() in PHP when register_globals is set to OFF?

When register_globals is set to OFF, using session_register() in PHP can lead to security vulnerabilities as it automatically registers the global variables in the session. To solve this issue, you should directly assign values to the $_SESSION superglobal array instead of using session_register().

// Fix for using session_register() when register_globals is set to OFF
$value = "example";
$_SESSION['value'] = $value;