If I read your question right, what you need to do is register the session variable at the start of your page, but it will only have a value assigned to it later on.
E.G.
<code>
// This must be at the top of your file.
<?php
session_register("username");
session_register("password");
?>
BLAH BLAH HTML CODE ETC ETC
<?
if you have validated the user and pass assign them to the session variables.
$username = "foo";
$password = "bar";
?>
NOW, foo and bar are accessable from any page, as long as you call session_start() at the begining of your page.
PUT simply, you must DECLARE your session variables at the top of a file, but you can access/assign values to them at any point, as long as you have started the session.
Hope this helps.