I had an old site with an admin area built with PHP and I've copied this site to rebuilt the front-end of our home page, but I can't make the admin login work properly on the new site.
I know it's connected to our database, because when I enter wrong password information, it shows a "login unauthorized" message and when I use the right credentials this message doesn't appear. The problem is that when I click the login button, it make a request to the page it should go, but then it receives a 302 response and return to the login page again.
EDITED TO SHOW ANSWER
The problem was that the session.save_path of the php.ini file was set to a path that didn't existed, so the session was not being saved anywhere, thus returning the user to the login page since his session was empty. After changing the path of session.save_path, the problem was solved.
Thank you to everyone that helped me!
print_r($_SESSION)<?phptag or any output before the session_start. Also,inc/session-control.phpshould be more useful for us thancadastro-xxxxxx.php