i read session_register is very old and just a few pepole use of it.
why? and what is better instead of it?
Quoth the obvious source of information on this subject:
[man]session[/man] Note: As of PHP 4.1.0, $SESSION is available as a global variable just like $POST, $GET, $REQUEST and so on. Unlike $HTTP_SESSION_VARS, $SESSION is always global. Therefore, you do not need to use the global keyword for $SESSION. Please note that this documentation has been changed to use $SESSION everywhere. You can substitute $HTTP_SESSION_VARS for $SESSION, if you prefer the former. Also note that you must start your session using session_start() before use of $_SESSION becomes available. The keys in the $_SESSION associative array are subject to the same limitations as regular variable names in PHP, i.e. they cannot start with a number and must start with a letter or underscore. For more details see the section on variables in this manual. If register_globals is disabled, only members of the global associative array $SESSION can be registered as session variables. The restored session variables will only be available in the array $SESSION. Use of $SESSION (or $HTTP_SESSION_VARS with PHP 4.0.6 or less) is recommended for improved security and code readability. With $SESSION, there is no need to use the session_register(), session_unregister(), session_is_registered() functions. Session variables are accessible like any other variables.
[man]session[/man] Note: As of PHP 4.1.0, $SESSION is available as a global variable just like $POST, $GET, $REQUEST and so on. Unlike $HTTP_SESSION_VARS, $SESSION is always global. Therefore, you do not need to use the global keyword for $SESSION. Please note that this documentation has been changed to use $SESSION everywhere. You can substitute $HTTP_SESSION_VARS for $SESSION, if you prefer the former. Also note that you must start your session using session_start() before use of $_SESSION becomes available.
The keys in the $_SESSION associative array are subject to the same limitations as regular variable names in PHP, i.e. they cannot start with a number and must start with a letter or underscore. For more details see the section on variables in this manual.
If register_globals is disabled, only members of the global associative array $SESSION can be registered as session variables. The restored session variables will only be available in the array $SESSION.
Use of $SESSION (or $HTTP_SESSION_VARS with PHP 4.0.6 or less) is recommended for improved security and code readability. With $SESSION, there is no need to use the session_register(), session_unregister(), session_is_registered() functions. Session variables are accessible like any other variables.
And
register_globals As of PHP 4.2.0, this directive defaults to off. Please read the security chapter on Using register_globals for related information.
register_globals As of PHP 4.2.0, this directive defaults to off.
Please read the security chapter on Using register_globals for related information.