I have a Drupal site (7) that I've migrated to a new server. I have a WordPress multi-site install on this server that looks like this at the moment:

  • example.com
  • store.example.com

I used to have a forum.example.com, but frankly the available WordPress forum options leave a lot to be desired, so I moved my old Drupal forum instead of migrating.

The issue is that I cannot log in to Drupal, from any account, even using a Drush generated link.

I've tried clearing caches, truncating session tables, adding $base_url in the settings.php file, setting session.name on both the WordPress and Drupal installations.
I'm at a loss. I've been banging my head against this for 4 hours now. I switched to a secondary domain (forum.example2.com) and it works perfectly; so all I can come up with is that there is some sort of collision between the two frameworks with either the sessions or the cookies.

Why cannot I log in with any account? How can I fix this?

Edit: To be clear, if I change Apache to point a different domain to this installation, everything works fine. I installed Flarum in place of drupal, and am able to log in. This problem is only present when the two frameworks are drupal and WordPress, and they are subdomains of the same main domain

Setting the user manually also doesn't work, for example:

global $user;
if(ip_address() == 'my.ip.address'){
   $user = user_load(1);

If I dump the user object after this it is loaded, but the next page load still leaves my as an anonymous user.

  • are both the wordpress and drupal files on the same directory then? if not, how are you separating them on the server and dns? Aug 4, 2017 at 22:23
  • Did you enable a2enmod rewrite?
    – No Sssweat
    Aug 5, 2017 at 0:55
  • Do messages appear or is anything logged when login fails? Have you tried clearing your browser cookies for the problem domain?
    – cilefen
    Aug 5, 2017 at 1:12
  • They are in their own directories, there is a wildcard dns entry, Apache has a wildcard directive and a forums directive.
    – Trey
    Aug 5, 2017 at 12:32
  • 2
    I found the problem, I was using the APDQC module on the old site and hadn't disabled it, not sure why, but it was the source of my issue. After disabling it the problem is gone.
    – Trey
    Aug 7, 2017 at 15:19

2 Answers 2


You should disable APDQC module on the old site.

The above was the answer given in comments. If the voting system requires you to choose a winner, I'm not above a simple comment repost answer :D

  • 1
    Lol you win this one
    – Trey
    Aug 10, 2017 at 20:34

I bet it was the COOKIE_DOMAIN in wp-config.php:

define('COOKIE_DOMAIN', 'sub.mydomain.com');

Define it without leading dot.

  • 1
    It was not, it was a module I forgot to disable
    – Trey
    Aug 8, 2017 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.