As title say, with PHP 5.6 users cant login with domain module enabled.
Cookies are correctly sent, session is created, logged in is registered on watchdog.
No error messages even on httpd/php logs.

My stack:
Nginx 1.6.2
PHP 5.6.2

With PHP 5.5.18 works well.

Edit: As suggested by #16 was in fact a core bug, so seems updating a session variable puts all running ok on php 5.6+

Changing this to support request and fixed (because this issue no longer is associated with this module).

Comments

jweirather’s picture

What is the behavior you're seeing when you submit login credentials? Does it happen for all roles? Does the page just reload? Can you navigate to admin pages as user 1?

PedroMiguel’s picture

The page just reloads and/or redirect to user page (as if login was done). This happen with all users/roles even with user 1. Can't access to any admin page as user 1 cant login. Need to do a "drush dis domain" (disable the module) in order to login to site.

pawel.traczynski’s picture

Greetings. I just wanted to confirm #2 :)

EDIT: Ok it was my bad. The problem appeared because I forgot to reset cookie_domain (settings.php).

I found out this helpful:

http://drupal.stackexchange.com/questions/131637/no-one-can-login-and-ac...

steveoriol’s picture

I confirm the problem

jweirather’s picture

@steveoriol: can you confirm whether cookie_domain is properly configured per comment #3?

Also the checklist per the link mentioned?

Are you using multiple domains, or multiple subdomains, or some hybrid?

Thanks-

steveoriol’s picture

@jweirather: I do not use multiple domains for this site. It is just a single site in the "default" folder...

jweirather’s picture

@steveoriol:

1) If you're only building a single site, I'm assuming you're not using (have not manaually installed and enabled) the Domain Access module, is this correct?

2) When you say "single site in the default folder", I'm not sure I'm following. All the installations I've been involved with have the site builds in the sites/all folder, where the sites/default folder is reserved for things like settings and uploaded file storage. https://www.drupal.org/documentation/install/modules-themes. If you're familiar with it, can you explain your setup a little further?

3) Was this an existing site that you upgraded to php 5.6, or is it a new installation in php 5.6?

I'll see what I can do to help.

jweirather’s picture

Please ignore my second question, I found some clarity on that. My bad. But please let me know about the other two..

steveoriol’s picture

I have builded the site under PHP 5.5.6, and it was OK in the development environment, but when I duplicate it on the production environment (PHP 5.6.1 for some security problem), all authentication fails with "Access denied"...
I tried to put it on an other server with PHP 5.3.3 and it is OK, so I really think it is a drupal core issue and not a "Domain Access" because I do not use it in this site.
So it is maybe better to continue with this issue on https://www.drupal.org/node/2379019

jweirather’s picture

Yeah, @steveoriol, your issue does not appear to be related to Domain Access.

If the problem occurred after file transfer, the first thing I would look to is hidden files and files with strong permissions. This would include the .htaccess file, and the settings.php file, both of which could cause issues with cookies/session data. If you don't go out of your way to copy them, then you may end up with missing and/or default versions. If you don't go out of your way to show hidden files (.htaccess), then it will not copy by default. Likewise, with the settings.php file, if you have it properly secured, then you may not be able to read it during the file copy process.

I'd check to make sure that those copied over successfully, or that your settings were properly maintained if you set up new versions at the destination.

jweirather’s picture

Also, as noted by @pawel.traczynski, if your dev and production environments use different domains or subdomains, you may need to udpate the cookie_domain in settings.php to reflect that.

PedroMiguel’s picture

Juste a note on this thread for clarification.

I have several versions of PHP on the server (5.5.19, 5.6.3, php-ng), so the site is the same, the permissions are the same, I just switch the php-fpm pool to another PHP version.

With PHP 5.5.x or below the domain module works well, with php 5.6.x or above users cant login.

I use several domains/tlds, not using any sub.

steveoriol’s picture

I agree with PedroMiguel, my site works well with PHP 5.3.x,5.5.x but with 5.6.x, users can not login anymore without using the password recovery link button...
and I have already done the change in settings.php and test the 'truncate table sessions'.
I think clearly that this problem come in because of the new version of PHP !

PedroMiguel’s picture

steveoriol, there is no bug with login with core itself (at least I had noticed), I have a bunch of sites with php 5.6 without domain module running on the server and all is ok. I also have some sites with PHP-NG (next generation php) where core login works also well.

steveoriol’s picture

OK PedroMiguel, in my case the problem it is maybe because of an other module, if you already have some sites workings under PHP 5.6.x...
what I am sure is, I have the same problem as you, without using domaine module.

Nikeev’s picture

Hello, I don't use Domain Access module in my project, but maybe this will help you. I had a login problem too with php 5.6. But there is a sessions bug in php core https://bugs.php.net/bug.php?id=68331 Now it seems to be resolved, but not in release yet.

My temporary solution according on it was to add in custom module new session data on user login.

function mymodule_user_login(&$edit, $account) {
  $_SESSION['mymodule']['ulogged'] = 1;
}

An idea was to update session variable to avoid php bug about custom session handler was not being called. So if session changed php called drupal custom variable and login system works fine.

Hope this helps.

PedroMiguel’s picture

Category: Bug report » Support request
Priority: Critical » Minor
Issue summary: View changes
Status: Active » Closed (works as designed)
steveoriol’s picture

Thank you Nikeev, your temporary solution works for me ;-)

aommundsen’s picture

I have the same problem after upgrading to php 5.6.3. Where do I put the code in reply #16, what file should I put that code in?

aommundsen’s picture

By the way, if I delete the cookie right before I log into Drupal, then it works, but only if I don't visit any pages after I delete the cookie.

Also when I change to Bartik theme it suddenly log in works again, but only a some sites. Other sites have the same problem also when using Bartik.

I found this interesting link at bugs.debian.org: Unable to log into Drupal 7 after install: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=766008 - as you can see the Debian developer don't consider this a bug in PHP.

So will it be a fix in Drupal 7 for this?

naheemsays’s picture

I dont think this is a bug in Domain Access - I am experiencing it after moving a site from one server to another.

Symptoms:

1. Go to site
1.a (check cookie, a cookie is attached)
2. log in
3. page refreshed, but you are still logged out.
3.a check cookies and there are now two cookies attached.

If you carry out step delete existing cookies after step 1 before logging in and dont refresh any pages, login is successful.

EDIT - my issue was linked to the nodejs integration module and not due to php5.6 or other cause. disabling the nodejs integration module fixed the problem.

PedroMiguel’s picture

nbz, yes Is not a domain access module bug, Initialy I think it was.

A few minutes ago I install a minimal drupal from scratch and can't login as user 1.

Solution: created a module as #16 suggest and enable it with drush.

Later today I will move this to drupal core. (just need to better describe the issue)

steveoriol’s picture

the issue already exists on https://www.drupal.org/node/2379019 since the 20 nov.

stevenlafl’s picture

I fixed it by adding:
$cookie_domain = '.';
to settings.php so I could actually get some development done locally.

The issue still exists in 7.34

jweirather’s picture

@stevenlafl - Thanks for posting your update.

yesct’s picture

Issue tags: -php56 +PHP 5.6
mfby2k’s picture

I am using drupal 7.40 on 4 of my site on same server. When I switched to php 5.6 (FastCGI) on my main site the login page was a white page with no error or any msg. One other site with domain www.sitename.com.pk totally fails to load.
I want to upgrade the main site to drupal 8 but it requires 5.6 php.