If you still happen to be maintaining a Drupal 5 or 6 website for a client you may encounter this problem of getting access denied even though you correctly entering the right username and password.
The first place to check, (and this is the most common solution), is to check the Sessions table in your mySQL database. Try repairing this table and that should do the trick. An easy way to do this is to use PHPMyAdmin.
In PHPMyAdmin, choose your Drupal database, check the box next to the Sessions table, and find the "With selected" drop-down near the bottom of the page. Choose "Repair table".
If repairing the Sessions table via PHPMyAdmin doesn't work, you can truncate the Sessions table. The repercussion of this being that all your users will have to log in again.