must be executed before any data is sent to the browser because it sends header information.
To set data into a session:
$_SESSION['value_identifier'] = "value";
is used just like any other PHP array with a couple of exceptions. When you call
in subsequent pages, the values you've set get restored. Secondly, and very conveniently, it is an "superglobal". This means that you don't have to do anything special to access it's values in functions or classes.