Hi all,

I am having a rather annoying issue with a drupal site which I have just moved from the server I was developing on, to the server that it is meant to be going live on. Unfortunately I can't seem to log on - the page simply refreshes (or redirects to the page you would expect if I was logged in - eg. my profile page) but I am not logged in! If I type my name or password wrong, it shows the error messages you would expect, but nothing when it's correct.

I am aware that there are similar issues reported on this site, some of them seem to be to do with clean urls, or caches from the old server etc, but none of their suggestions seem to work. Also, unlike the others, I can't even log in with a one-time login link generated through drush.

Here are some of the things I have tried: -

  • Disabling clean urls before transferring across.
  • Clearing caches (both before moving and with drush on the new server)
  • Setting the cookie domain in settings.php
  • Clearing the sessions table
  • Clearing my cookies locally
  • Viewing the site in an anonymous window
  • Logging in with a one-time password
  • Shouting at the screen

Some information about the server:

It is a rackspace cloud server, running:
ubuntu 10.04
php 5.3.2
mysql 5.1

It is set up using virtualhosts, the site lives in a subdirectory of one of these. In the root of this particular virtualhost there is a wordpress install (which is going to be replaced by this drupal site when it is running properly!)

Some more information from my investigations:

The sessions table is being populated when I attempt to log in. The uid is being set (unlike some other similar issues) - but the session column appears to be empty.
Watchdog reports that a session was opened for my username.

The one major difference I have spotted between the dev server and the live is that an auth cookie is not set on the live server. I created a small script just to run in the same directory that sets a cookie, and another to read the cookies for this domain (independent of drupal) - setcookie returns true, but even this cookie does not show up.

I would be very grateful if anyone had any pointers as the site is for a client and I would like to get it set up!

Thanks in advance, Tigerfinch

Comments

Alessandro77’s picture

I am interested in the same problem. Do you have any update?

jaspher’s picture

I have the same problem. I'm on localhost, wamp.

I had issues with the secure login module giving me "page not found' on the user sign in and on forms. Disabled the module in the DB, and removed the module from the modules folder. This helped with the 'page not found', but now I'm experiencing the same problem you are.

---
my blog

prodigeek’s picture

Anyone solve this issue? I am having this problem as well.

borys’s picture

I had the same problem, fixed with removing wrong $cookie_domain value.

Common issue is wrong $cookie_domain in settings.php, try to remove it or set proper value (URL).

If it doesn't work, try to check all things that described in this post - http://drupal.stackexchange.com/questions/4158/i-cannot-log-into-after-m...

mennonot’s picture

The instructions worked for me:

"The solution is in your Apache config file. Enable ‘LoadModule rewrite_module modules/mod_rewrite.so’ in httpd.conf file and clear the cache and then login again."

From: http://drupal.stackexchange.com/questions/103752/user-login-page-displays-but-gives-a-404-error-on-firebug

To get this working, I first had to install the mod_rewrite module using these instructions: http://stackoverflow.com/questions/869092/how-to-enable-mod-rewrite-for-apache-2-2

mizage@gmail.com’s picture

rewrite_module did the trick for me as well

hockey2112’s picture

Another thing to check: make sure that your htaccess is directing users to the https version of the site URL. Here's what I use at the top of the htaccess file:

# Redirect to HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

I also have my cookie domain set to https://mydomain.com

Before adding the info to the htaccess file, if I went to http://mydomain.com and logged in using a login block (for example), it would then redirect me to https://mydomain.com and would not log me in. I would then have to resubmit my info after that pager reload, after which the login action worked.