From 53d13b3cf191bf84ccb864dec54ae71bc389e1bd Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Tue, 17 Dec 2002 10:30:05 +0000 Subject: [PATCH] improvements git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@108362 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../functions/session-is-registered.xml | 6 ++--- .../session/functions/session-register.xml | 22 +++++++++++++------ .../session/functions/session-unregister.xml | 8 +++---- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/reference/session/functions/session-is-registered.xml b/reference/session/functions/session-is-registered.xml index 7003f34843..3c79b070d6 100644 --- a/reference/session/functions/session-is-registered.xml +++ b/reference/session/functions/session-is-registered.xml @@ -1,11 +1,11 @@ - + session_is_registered - Find out if a variable is registered in a session + Find out whether a global variable is registered in a session @@ -16,7 +16,7 @@ session_is_registered returns &true; if there - is a variable with the name name + is a global variable with the name name registered in the current session. diff --git a/reference/session/functions/session-register.xml b/reference/session/functions/session-register.xml index 09d7c252c6..2780239210 100644 --- a/reference/session/functions/session-register.xml +++ b/reference/session/functions/session-register.xml @@ -1,11 +1,11 @@ - + session_register - Register one or more variables with the current session + Register one or more global variables with the current session @@ -22,6 +22,14 @@ each name, session_register registers the global variable with that name in the current session. + + + If you want your script to work regardless of register_globals, you need + to use the $_SESSION array. All $_SESSION entries are automatically + registered. If your script uses session_register(), it will not work in + environments where register_globals is disabled. + + This registers a global variable. If you want to @@ -70,21 +78,21 @@ $HTTP_SESSION_VARS["spongebob"] = "He's got square pants."; - It is not currently possible to register resource variables in a - session. For example, you can not create a connection to a + It is currently impossible to register resource variables in a + session. For example, you cannot create a connection to a database and store the connection id as a session variable and expect the connection to still be valid the next time the session is restored. PHP functions that return a resource are identified by having a return type of - resource in their function definitions. A + resource in their function definition. A list of functions that return resources are available in the resource types appendix. If $_SESSION (or $HTTP_SESSION_VARS for PHP 4.0.6 or less) is - used, assign variable to - $_SESSION. i.e. $_SESSION['var'] = 'ABC'; + used, assign values to + $_SESSION. For example: $_SESSION['var'] = 'ABC'; diff --git a/reference/session/functions/session-unregister.xml b/reference/session/functions/session-unregister.xml index 88c0e0f812..5472d66024 100644 --- a/reference/session/functions/session-unregister.xml +++ b/reference/session/functions/session-unregister.xml @@ -1,11 +1,11 @@ - + session_unregister - Unregister a variable from the current session + Unregister a global variable from the current session @@ -15,7 +15,7 @@ stringname - session_unregister unregisters (forgets) + session_unregister unregisters the global variable named name from the current session. @@ -33,7 +33,7 @@ - This function doesn't unset the corresponding global variable for + This function does not unset the corresponding global variable for name, it only prevents the variable from being saved as part of the session. You must call unset to remove the corresponding global variable.