BOOzy,
Is the parsing engine giving you any errors?
Also, there is no need to unset $logout - the header call will actually force the browser to a new page, this clearing your POST/GET'd variable $logout.
The header function normally fails if something has outputted information before it, and the scripting engine normally flags this up. You should have noticed it if that was the case.
Other than that, I can't see any problem with your code.
Hope this helps,
Mark.