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.
The other important reason sessions can not work is playing with the session cookie settings, eg. setting session cookie lifetime to 0 or other low values because of simple mistake or by other developer for a reason.