note 27022 deleted from function.session-start by philip

From: Date: Fri, 13 Dec 2002 18:05:22 +0000
Subject: note 27022 deleted from function.session-start by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-40870@lists.php.net to get a copy of this message
Regarding the use of session variables inside functions. It seems that session variables are always global, even if you are using them inside a function. It means that you must do the following to use them: function func_name() { session_name("session_name"); session_start(); global $session_var; // this is the session variable .... }

« previous php.notes (#40870) next »