Fixed header() redirection

Fixed header() redirection when the logins are good.