I have problems logging into two of my three drupal sites. The problem is that I have to type in my username and password two or three times before the system logs me in. No error messages are given if the login fails (but I can get the site to give me the standard error message if I deliberately type in the wrong password).

The strangest thing is that all three of my sites run of virtually identical code bases. I have a "live" site, a "development" site and a "local" site which is installed on my own WinXP workstation. The "live" and "development" sites often run on exactly the same code bases and on the same server. At one stage the development site was using an exact replica of the live site's database too!

The live site never requires multiple logins but both the development and the local sites often require multiple logins!

Any hints would be very helpful.

Comments

dan_aka_jack’s picture

Status: Active » Closed (fixed)

I've set the RewriteBase correctly in the .htaccess and I've also cleared the SESSIONS and CACHE database tables and it seems to be functioning normally now. I'll report back if I get any more problems with logging in and out.

Thanks,
Jack

cosmicdreams’s picture

Status: Closed (fixed) » Active

I understand that the codebases are identical, just not which version they are all running. CVS? beta6?

If the problem you are having is with beta6 there is a good chance that the issue has been raised and fixed already. I seem to remember reading about multiple login issues before.

The site I run for friends also displays this behavior. But they don't want to move to the updated code until its ready.

cosmicdreams’s picture

Status: Active » Closed (fixed)

didn't mean to change the status

dan_aka_jack’s picture

Version: 4.7.0-beta6 » 4.7.0-beta5

Hi,

My site's actually running beta-5.

dan_aka_jack’s picture

Status: Closed (fixed) » Active

Hmm... I'm still getting multiple-login problems.

Unfortunately, I wont be upgrading my code base until at least a release candidate comes out. To be honest, I'll probably hold off until the full release of 4.7 comes out.

moshe weitzman’s picture

Status: Active » Closed (works as designed)

make sure your php configurations are identical. and sudo apachectl restartche. this is likely a caching problem outside of drupal. drupal coul help matters though by emitting cache-control headers. for now, it isn't designed to do so. and we have existing issues about that.

markus_petrux’s picture

I believe this is the same problem described here:
http://drupal.org/node/56357

dan_aka_jack’s picture

Hi,

Thanks for your replies.

Markus: I'm not sure I agree that the double-login problem described on this issue is the same as the "Cannot stay logged in on more than one site on the same server" issue you linked to above. I, too, have experienced the "Cannot stay logged in on more than one site on the same server" problem and am confident that it's a different issue to the "Multiple logins required" problem that I'm describing here.

markus_petrux’s picture

It is hard to tell what happens, Jack. Maybe if you were running 4.7beta6 and up. Note that there has been a significant change in regards to session management (the session_regenerate_id stuff).

"Multiple logins required" shouldn't happen in normal ciscumstancies. I would check with latest Drupal core, with no contrib modules and see if it works. If not, make sure you have register_globals off, review your session/cookie settings, etc. If still with problems, you would have to post more information such as your PHP/Webserver version, PHP settings related to session, cookies, etc. Problems with all browsers? Are you behind a proxy? Does your IP change between requests? Have you noticed if the value of the cookie PHPSESSID changes between requests? Does it get reflected in the sessions table?

dan_aka_jack’s picture

OK, I'll update my installation to the latest code within the next few weeks and report back.

Thanks,
Jack

dan_aka_jack’s picture

OK, I think at least part of the issue is a caching issue. Here's a pretty sure-fire way to get the problem:

1. Make sure you're logged out
2. Clear your browser cache
3. Browse your site a little bit (e.g. go to your forum page)
4. Go back to your front page and log in
5. Now re-visit the pages you visited when you were logged off

When I do this, I appear to get "logged out" when I re-visit pages I visited while I was logged off. But if I press F5 (reload) on a page that I seem to be "logged out of" then all is well and the site shows me as being logged in.

In other words, I think my browser is caching pages in their "logged out" state and not re-loading them after I log in.

dan_aka_jack’s picture

Status: Closed (works as designed) » Closed (fixed)

OK, I've updated to the latest code from the CVS and everything seems well.

Thanks,
Jack

dan_aka_jack’s picture

Actually... just updating to the latest code didn't fix my log-in problems. I also had modify settings.php as listed in http://drupal.org/node/56357 .

dan_aka_jack’s picture

Other people are getting a similar problem:

Cache causing users to appear logged out under certain situations

killes@www.drop.org’s picture

Version: 4.7.0-beta5 » 4.7.0-rc2

Please retry on a more current code base.

dan_aka_jack’s picture

Hi Killes,

Thanks for the reply.

I'm using the CVS code downloaded yesterday and I'm still getting caching problems. To re-cap, my problem is this:

1) I go to my site and browse as an anonymous user
2) Then I log in.
3) It appears as if the first log in attempt fails because my browser returns me to the cached, anonymous page. Pressing control-F5 fixes the problem.
4) Sometimes, when browsing through the site as a logged-in user, it appears as if I get logged out if I visit pages which I previously visited as an anonymous user. Pressing control-F5 fixes this problem.

In other words, it seems to be a caching problem whereby pages get cached in their "anonymous" state and the cache isn't flushed when I log in.

moshe weitzman’s picture

Title: Multiple logins required » too aggressive page caching

this has been one some servers for a long time. It is hard to fix. The bug/'missing feature' is somewhere in http://drupaldocs.org/api/head/function/drupal_page_header.

also see http://drupal.org/node/18390

kloomis’s picture

Version: 4.7.0-rc2 » 4.7.2

I am having the same problem - all users have to log in twice. I am running 4.7.2 (regular not CVS) I have Drupal caching disabled. My optional modules are basicEvent, Content, Event, Help, Menu, Page, Story, Taxonomy, Text, tinyMCE, and Upload.

This does not occur in 4.6. I'm not able to recommend an upgrade to customers with this situation.

I did have the "can't create first user" problem when I installed this site. I wonder if others with the login problem had the first user problem too, and if the two are might be related.

Ken