Login doesn't work or must be done twice
There are at least two possible reasons why you can experience a symptom of "Visit the site, login, and while the username and password are correct the user does not appear to be logged in."
Cookies
Make sure cookies are enabled in your browser.
Cache Problems
It seems that sometimes the cache doesn't get updated when logging into a site so even after logging in the user is still shown the cached version of the site: not logged in. The source of this problem (browser, webserver, Drupal settings) is not completely understood.
One solution seems to be to disable the Drupal cache of the site, though that has the undesired side effect of increasing the load on your site.
Another workaround is for the users to hit the browser refersh button which seems to work fairly well, but has the drawback of not being easily discoverable and is a hassle for every user of the site. On a site where only one or two users login, this is not a problem. On a community site it is a bigger problem.
For the next version of Drupal - the problem is fixed as a result of this issue.
Logging in at www on a site with no www in the baseurl
This problem is more easily understood and fixed. If a site is set with http://example.com as the base URL and the user types www.example.com into his URL then he will still be presented the main page. When the user uses the login block to login then Drupal will send them a cookie with www.example.com as the domain and will forward the user to http://example.com where the cookie will not be valid and the user will not be logged in. One solution to this problem is to configure your server so that the URL and the Drupal settings match perfectly. If you are using apache and .htaccess is enabled you can achieve this with an .htaccess rewrite directive inside of the "Various rewrite rules" section:
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]While the example has always been to remove the www, the problem and this solution can be reversed for adding www.
This second issue has been fixed for the "next" version of Drupal in this issue
