To trouble shoot, add the following code after the <body> tag on your Log In and Profile page:
<pre><?php var_dump($_SESSION); ?></pre>
This will write the contents of the session to the page.
After logging in, note the session variables that are listed, then go back to the login page, the same session variables should be listed with the same contents. Please post the results of this experiment and a copy of the login and registration page.