This function register one or more global variables with the current session.

Syntax: session_register ( mixed name [, mixed …] )

Description:

session_register() accepts a variable number of arguments, For each name, session_register() registers the global variable with that name in the current session. It does not assign a value to the session variable.that this function takes the name of a variable as argument, not the variable itself. You can use session_unregister() to remove variables from the session, for example, when the user removes a product item from the shopping cart.

Example:
Code:

 
session_start();
session_register("session_variable");
$session_variable = "xyz123";
print "session_variable: " . $session_variable;
session_unregister("session_variable");

Output:

session_variable: xyz123

eXTReMe Tracker