I bet the session is not being started. Remove the @ infront of
session_start() and report back if there are any errors. For the
session stuff to work the headers need to be set. So if you are
printing anything out before the session_start() then it fails. That
even includes any space between the begining of a file and the <?.