Here are the code of my login page where the login script checks for the authenticity of the user and then redirects to inbox page using header function.
Maybe if your session path is not working properly you can try session.save_path(path/to/any folder); function as alternative path. If it works you can ask your hosting provider about default path issue.