This code looks right. Maybe it is an issue with the data in the database or an issue with the success redirect page not properly identifying the login user.
What is the exact issue? Does it not allow you to log in? Does it always log you in? Do you get an error?
If you give me FTP access and a URL to reproduce the issue as well as the username and password you are using, then I can debug and tell you why it isn't working.