Unable to Login to Drupal - Cookies

    Based on your particular configuration, Drupal may not proceed beyond the login screen and may persistently give you the login page even if in the backend you are logged in. This problem occurs much easily in Internet explorer and less in Firefox 1.5. You can by pass this problem by clearing you cookies before logging in after loading the first page of the site in question (This is just a troubleshooting by-pass as you cannot mandate your web users to clear cookies manually every time they login).

    The problem is caused by Drupal's inability to clear the anonymous cookie and replace it with a new cookie for your logged-in session. As mentioned above, this is more prevalent in IE and does not seem to be specific to any particular operating system. The issue is very eloquently described in http://drupal.org/node/55364.

    Attempted Solutions

    There are a number of suggested solutions and walk-arounds that can get you from a moment of proper functionality, to permanent resolution with some consequences especially regarding SEO since some solutions require not using cookies, and switching to session IDs being embedded in the URL.

    • Clear cookies after loading the initial login page to eliminate the anonymous cookie to allow the logged-in cookie to persist without conflict.
    • Modify the session.name variable in PHP to avoid conflict with cookies created by other Drupal sites (this does not solve the problem of cookies from the same site - which is the nature of the present problem)
    • As explained in http://drupal.org/node/55364, upgrading to a higher version of PHP may solve the problem as well as switching off the use of cookies and using URL embedded session IDs to maintain state - this will create ugly URLs for search engines to index
    • Destroy the session cookie to prevent multiple domain cookies at logon as detailed in http://drupal.org/node/60584
    D-NB: This pages will be update once there us a clean definitive solution