Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: how to access (and change) a session variable from within a function


Message #1 by "Louis Halleux" <louis.halleux@f...> on Mon, 29 Jul 2002 20:49:54
Thank you, I think this is the cleanest way to access session variables
from within a function.
Louis

> 
Use the superglobal array, $_SESSION, to access session variables directly.

for example:

function do_login($username, $password)
{
   // check username and password here

   if($valid_login)
   {
      $_SESSION['logged_in'] = true;
   }
}


nik


  Return to Index