Sometime when I have been logged out due to inactivity and then log in again, I end up at http://example.com/autologout_ahah_logout and the screen is a blank white screen (if I inspect the source code there is none).

There are no errors in the logs.

It possibly happens only when you get your password wrong, but I'll have to try to confirm that.

I'll see if I can work out a consistent way to make it happen.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

johnennew’s picture

Hi Rooby, If you are able to replicate can you try the latest dev release and see if it is already fixed there?

I think the problem is to do with the drupal_get_destination() method which will provide that as the destination for the callback in odd situations. I thought this had been fixed in 4.2 but maybe its still in dev. It may be there are other situations this happens in though.

johnennew’s picture

Hi @Rooby - were you able to replicate this at all?

rooby’s picture

It definitely still happens but I haven't tried to pinpoint when yet.

I am back on this project in the next day or two and will report back then.

rooby’s picture

This is still happening but there seems to be no pattern.

Sometimes it happens after I have been auto logged out and try to log back in (regardless of if I enter the right password or now), but sometimes it doesn't happen.

Also, sometimes it happens when I freshly navigate to the site and try to log in, without having been recenly auto logged out.

I haven't had a chance to properly debug yet.

rooby’s picture

In the drupal watchdog log I have these two messages one after the other:

Session opened for username.
Session automatically closed for username by autologout.

johnennew’s picture

Version: 7.x-4.2 » 7.x-4.x-dev
Status: Active » Needs review
FileSize
673 bytes

Hi @rooby, I wonder if the session time autologout_last is being saved in the session and not reset during login and being loaded from the session table. If an old value is reloaded then the user will immediately be logged out.

Can you review the following patch?

rooby’s picture

I was wondering about that too - and this as a possible solution.

I tried for a while today to work out how to reproduce the error reliably so I could test and had no luck.

I will try again tomorrow (along with the patch), I am doing a lot of work on this project this week.

rooby’s picture

I'm not sure why exactly the session would not be clearing but if it wasn't, then the check against autologout_last could potentially give this unexpected result.

However, in this case, after checking the time left the dialog should pop up right?

Another thing I see is in the js:

          paddingTimer = setTimeout(confirmLogout, localSettings.timeout_padding);

This means that confirmLogout could possibly be called without ever seeing the dialog, but in my debugging it seems that timeout padding is always 15 seconds and the process of logging in and getting the white screen is no where near that long (although I am checking the timeout padding value at the php level, not the js level).

Plus the only use of the autologout_ahah_logout url as far as I can tell is via ajax so to end up on that page means there is something going wrong.

I really want to know the exact cause of this, it's bugging me :)

Anyway, I'm just going to apply your patch now and see if the problem stops.

Generally it happens to me every morning the first time I log into the site but then not again if I try to reproduce it, so I should know in the next day or two if it has stopped it.

rooby’s picture

After upgrading to dev I see the whole hook_user_login() is new and maybe that session cleanup could help things.

Maybe I will first try latest dev without the patch and then if it still happens, with the patch.

rooby’s picture

Issue summary: View changes
Status: Needs review » Closed (cannot reproduce)

I haven't seen this issue for a few days and I usually see it every day so I think updating to the latest dev has fixed the issue.

Closing for now and I will reopen if it comes back.

Also, feel free to reopen if you want to commit your patch from #6, but it doesn't seem to be needed.

johnennew’s picture

Thanks for reporting back on this @rooby, I think a new release is needed.

I'm going to get this issue sorted and then roll a new release:
#2014473: AJAX ERROR 404 NOT FOUND

rooby’s picture

Status: Closed (cannot reproduce) » Needs review

I have had this happen again twice this week, although it is still definitely happening less often than before.

I will try the patch out and see if it helps and doesn't ahve any negative effects.

rooby’s picture

Here is a new version that applies to latest dev. Same functionality.

johnennew’s picture

Hi Rooby,

Do you think it could be related to the following issue?
https://drupal.org/node/2129297

rooby’s picture

In my case I don't think so.

I don't remember seeing any ajax urls like that and the site doesn't really have much in the way of ajax functionality anyway.

rooby’s picture

Today I have seen the error again, with the patch.

It doesn't happen all the time though and I don't know how to reliably reproduce it.

johnennew’s picture

Status: Needs review » Needs work

Changing the status to needs work. If anyone can supply further details to replicate this bug that would be helpful.

johnennew’s picture

Status: Needs work » Closed (cannot reproduce)