For some reason a login script I've been using has suddenly decided to stop working. The script is being used in three locations. It has stopped working on my local server and on an external server. On the other external server it is working though. I have tried downloading the files from the working server to use on others but it won't work and rather than return the main page, it loops back to the login page.
Im fairly sure session_start() needs to be at the top of the file, you will also encounter issues with using headers in the middle of the script without using output buffering.
The headers will cause an error along the lines of ERROR: Headers already sent......