User Log-out Problem

wolfderby - December 4, 2007 - 20:17
Project:Drupal
Version:6.x-dev
Component:user system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active (needs more info)
Description

This seems to be cache related.

If I log-out it doesn't seem to logout. And if I logout twice it says access denied.

note: if you login to the logout page... it logs you out :D

It seems that if you visit the homepage in the middle of you session and then log-out, your typical navigation menu stays as well as the log-out links... then once you try to go to a access restricted page, it says access denied.

Also logging out once, (even if it doesn't appear you have) then clearing browser cache and refreshing, load's the page correctly (views as if you've logged out)

Possible work arounds
disabling cache in admin/settings/performance
and putting

<?php
cache_clear_all
($url, 'cache_page');
?>

#1

wolfderby - December 4, 2007 - 21:03

Under possible work arounds I should have said "or putting code" instead of "and putting code"

Putting just that code in my view header seems to have fixed it for me. I still have cache enabled.

#2

drumm - December 5, 2007 - 19:36
Status:active» active (needs more info)

Does the page fix itself after holding the shift key while reloading in Firefox? Are all browsers affected?

Does this happen when Drupal's page cache is off?

#3

criznach - December 6, 2007 - 06:20

What sort of internet connection are you on? Satellite by chance?

#4

wolfderby - December 6, 2007 - 22:52

What sort of internet connection are you on? Satellite by chance?

I'm on verizon cable internet.

#5

wolfderby - December 6, 2007 - 23:09

Does the page fix itself after holding the shift key while reloading in Firefox?

The page fixes itself when hitting ctrl+shift+f5 to clear cache and refresh the page.

Are all browsers affected?

Firefox 2 and IE7 seem to be affected.

Does this happen when Drupal's page cache is off?

No, it does not seem to happen when Drupal's page cache is off, but does seem to when Drupal's caching mode is set to normal.

#6

mrMaze - February 7, 2008 - 19:44
Version:5.3» 5.6

Is there any way to only have

<?php
cache_clear_all
($url, 'cache_page');
?>

only happen at logout, and not every time the home page is visited? Currently I have set the caching to off - my client uses Firefox - but I need to be able to have caching on, which seems pointless to a degree if the cache is being cleared every time the homepage gets viewed. Please correct me if I have interpereted this incorrectly...

#7

mrMaze - February 8, 2008 - 19:23
Version:5.6» 5.3

Also, I am having this problem with 5.6.

#8

Ugljesa - March 2, 2008 - 11:44

I am experiencing the same problem, but sometimes a page reload helps sometimes not. [edit] Another thing i noticed. If i log out and then try to log in as a different users, it does not change, i am still logged as previous user. [/edit]

#9

psynaptic - March 4, 2008 - 14:23

I've just had one of my clients report this as an issue but I can't seem to reproduce it. I'll report back here when I have more details.

#10

Arancaytar - March 4, 2008 - 17:35

I've experienced this numerous times with a number of Drupal sites, including drupal.org. I think all of the times I've seen it, I was browsing on a UMTS connection.

#11

psynaptic - March 6, 2008 - 11:07

We still haven't been able to track this down or reproduce it. It's probably browser based, something to do with cache or whatnot. Our clients use IE7 (lamers) so that could have something to do with it. What browsers have you guys been experiencing this with?

#12

Arancaytar - March 6, 2008 - 14:21

I've seen this in both Firefox 2 and 3. But as said, this is on a UMTS connection where the provider does all kinds of stuff with the content that is transmitted (caching, gzip, etc.)

#13

future assassin - March 12, 2008 - 23:56
Version:5.3» 5.7

I just started having the same problems with Firefox a few days ago when I activated caching although I'm can't say for sure if it started after that or after installing a few other modules in the mean time. The site does work fine with IE7 and Opera 9.26

I've installed the following since activating cache

globalredirect
Calendar
Event 5.1 and upgraded to 5.2
Private Message from (UberCart)

Actually I just did some quick testing and I deactivated caching and rectivated it and it seems to for now solved the logout/login issue. I've been trying with several user names logging in and out and it works fine. I'll update if it starts again.

#14

ttosttos - March 25, 2008 - 05:18

I'm able to consistently reproduce this issue on a fresh 5.7 install using:

1. Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.7
2. Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
3. MS IE 7.0.5730.13

Go to your site and log in. Open a second tab and go to your site. Log out. Go back to first tab and try to log out. You get access denied and are requested to log in. As described above, a success login at this point has the effect of successfully logging you out.

#15

intent - April 15, 2008 - 14:10

Nothing to add except that I added the php code offered by the OP as directed and that is working on my site. Just adding this comment so as to subscribe to and follow this issue.

(Is there a way to subscribe to an issue without adding a comment?)

#16

parrottvision - April 17, 2008 - 20:26

same problem for me. definitely seems a cache issue. if I apply the code in #6 will this affect all pages or only home page? I need caching on. I get it intermitently on firefox and am sure I have replicated on safari and IE6 - although I am tired and cant remember well. helpful huh... I am using 5.7

#17

glass.dimly - April 18, 2008 - 14:34

The only thing I changed on the page was to enable cache and now the system won't allow me to logout. So same problem as above. The client needs to cache the site or the server crashes under heavy traffic. I'm using Drupal 5.4.

#18

mrMaze - April 28, 2008 - 23:00
Version:5.7» 5.6

I am still having this issue on the most current version of FF. In fact, it is so bad that I have been having to repair tables in the DB because FF leaves connections open...

Something I have been trying to do is get my client to log out, then close firefox to prevent problems. But they are forgetful, so it doesn't always work.

#19

cdemetriadis - May 6, 2008 - 11:58
Version:5.6» 5.7

I'm having the exact same issues with firefox.

It just seems that ff caches the home page. When I logout I get redirected to the home page which still displays as if I were logged in. I then clear my cache and refresh the page and it displays as if I'm logged out.

Does anyone know if there's a fix for this?

I'm using D5.7

#20

introfini - May 6, 2008 - 13:50

Hi,

I have some clients with the same problem (IE). Deleting all the cache tables and clearing the cookies and the browser cache doesn't fix the problem. The only thing that works is changing the browser!

introfini

#21

gash - May 26, 2008 - 18:24

I'm experiencing identical issues with both FF and Safari (running on OS 10.4; not tested on windows). With normal caching enabled, all is fine for a day or so, but eventually I see the exact behavior described here. In fact, when it last occurred, a flush of either browser's cache did not resolve the problem (a trick that had worked previously, oddly); I had to disable drupal caching to get things back to normal. I'm using an Ubercart installation running on Drupal 5.7. PHP version is 5.2.6, MySQL 4.1.11. My home connection is via Charter cable. I'm sure the fix posted will work, but wanted to give some more info for those trying to track down and resolve the root of the problem. Thanks.

#22

aexl - May 28, 2008 - 20:32

confirming the problem with firefox 2 and 3.
(this really sucks)

>Also logging out once, (even if it doesn't appear you have) then clearing browser cache and refreshing, load's the page correctly (views as if you've logged out)

confirming this too here

#23

criznach - June 5, 2008 - 17:10

#18 - Firefox does not leave connections open, PHP does. Try the suggestions in this post.

http://drupal.org/node/42626

I suspect you're hitting some server side limitation that can be changed.

#24

bigsend - June 22, 2008 - 08:43
Status:active (needs more info)» active

I have this exact problem too.

Is there any resolution yet?

#25

cmillet1 - June 24, 2008 - 02:34

I just started having this problem as well. I haven't upgraded Drupal or any modules, and this is actually a very minimal installation. I have recently upgraded to Firefox 3 (Mac), which I would say is the cause of the problem, but it's also happening with Safari.

Anyway, I'm just commenting so I can subscribe. And I also find it annoying that I can't subscribe without commenting.

#26

bigsend - June 24, 2008 - 04:07

The problem went away when I went to Site-Configuration --> Performance --> set Caching mode to disabled. Although I don't want to disable it, clearly there is a problem there....

-BigSend
http://bigsendworld.com
http://mydrupaladventures.com

#27

awolfey - June 24, 2008 - 13:40

I'm having what I think is the same problem, 5.7, using firefox. When I log in, I get a white screen on the url: http://mysite.com/node?destination=node. If I refresh that page I get these errors:

* warning: Cannot modify header information - headers already sent by (output started at ..../themes/velocity/template.php:1) in ........./includes/session.inc on line 100.
* warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in ....../includes/session.inc on line 103.

When I logout I get the white screen on http://mysite.com/logout. When I refresh I get access denied.

This is a new site and I have never had caching on.

This just started yesterday as I was reworking my custom login blocks, but I can't see anything that I screwed up.

Is this the same problem?

Thanks.

#28

awolfey - June 24, 2008 - 14:42

OK, it was working fine in IE6 so I restarted, cleared the firefox cache and my site cookies and all seems to be working again.

#29

cmillet1 - June 24, 2008 - 18:35

I really don't think this is a browser problem, or if it is it's a browser AND Drupal problem. I am seeing the problem in multiple browsers. I also have Drupal's caching disabled and that's not fixing it. I've even gone so far as to manually delete all rows in all the cache tables, to no avail.

#30

cmillet1 - June 24, 2008 - 18:58

I really don't think this is a browser problem, or if it is it's a browser AND Drupal problem. I am seeing the problem in multiple browsers. I also have Drupal's caching disabled and that's not fixing it. I've even gone so far as to manually delete all rows in all the cache tables, to no avail.

--sorry about the double-post--

#31

cmillet1 - June 24, 2008 - 19:39

Ok - looks like borked session data. I fixed my problem by clearing the 'sessions' table in my database. Still not sure what caused the problem in the first place, but that worked.

*CORRECTION* Now I won't stay logged IN.

#32

joncup - July 3, 2008 - 23:01

i just started having this issue also when i enabled the page cache, i'm going to try the fixes above, but Im going to follow this issue until a fix comes up. -subscribing-

#33

henns20 - August 20, 2008 - 04:09

tracking - having same issue seems like

to recreate issue -

  • select Performance -> Caching mode: -> Normal (recommended, no side effects)
  • Entered site as Authenticated user role (in my case editor with editing permissions)
  • Using User Login Block and login toboggan block Block Type link
  • Try to Logout it puts you in a loop not able to determine if you are logged in or out.
  • Able to get out of the loop by going to example.com/user (typing directly in the Browser Url address Bar) and signing in as Super User
  • Also

  • Problem stops when disabling Cache Mode

Update:

  • Thought i was able to get a resolution ...When I recreated my steps - without a login toboggan block i do not seem to have any of the issues....but came back after further testing

#34

gu3st - July 24, 2008 - 16:22
Version:5.7» 5.8

This happens to me on 5.8 as well, and I also have normal caching enabled and am using login toboggan, but I'm not sure it has anything to do with the problem. It seems to be a caching bug.

I also wonder if this temporary quick fix clears cache for only homepage or all pages?

<?php
cache_clear_all
($url, 'cache_page');
?>

Thanks

#35

gu3st - July 24, 2008 - 17:46

This is a disaster.

I even disabled the login toboggan module, cleared the sessions table, disabled all caching and made sure cache tables in the database are empty, yet the same problem keeps happening and homepage (and possibly some other pages) seem irreversibly stuck to the same state, even after I cleared browser cache (I tried it in other browsers which I never used for this site before and it's stuck to the same page there as well). I can tell it by that it keeps saying the same number of users online, and I also made one node to display on front page, but it didn't.

There's something seriously wrong here. This is why I hate drupal upgrades. It's so unstable and buggy all around.

EDIT: OK, suddenly it came back... I don't really get it. It's as if cache cleared with a delay... Maybe the /tmp directory needs to be emptied too?

Anyway, now it does look like Login Toboggan is the culprit.

#36

bigsend - July 25, 2008 - 23:53

Is there an active bug report for this?

As in, I know there is this thread, but is there an offical bug ID number for this and progress going on? If only I knew enough PHP to help out...

-Thanks
BigSend
http://bigsendworld.com
http://mydrupaladventures.com

#37

pramudya81 - July 26, 2008 - 03:28

It happens on Drupal 5.7 too but only for FireFox. IE performs well.

Regards

#38

watbe - July 27, 2008 - 18:38

still happens in 5.9... I have this problem as well, I can't seem to logout without changing tabs or restarting FF

definitely not logintoboggan causing the problem, I don't have it installed.

#39

mjourney2 - July 29, 2008 - 14:06
Version:5.8» 6.3

Same issue with Drupal 6.3:

With caching turned on, it refuses to log me out and when I do eventually log out (e.g. after manually clearing cookies, which some times works some times it doesn't) then it struggles to log me back in.

#40

Damien Tournoud - July 29, 2008 - 15:16
Version:6.3» 6.x-dev
Priority:critical» normal
Status:active» active (needs more info)

Unable to reproduce this. This bug seems transient. Please anyone affected give as much detail as possible about your environment (browser, extensions, proxy used, internet provider, Drupal version, installed modules, etc.), and details about how to reproduce. Lowering priority until someone can reproduce this in controlled conditions.

#41

tknospdr - July 30, 2008 - 16:34

subscribing

#42

joncup - July 30, 2008 - 18:34
Version:6.x-dev» 5.9

having this problem with 5.9

#43

Damien Tournoud - July 30, 2008 - 18:36
Version:5.9» 6.x-dev

@joncup: as I said, this issue is hard to reproduce. Please give as much information as possible about your environment (browser, extensions, proxy used, internet provider, Drupal version, installed modules, etc.), and details about how to reproduce.

#44

mjourney2 - July 31, 2008 - 00:08

For my part, I am running Drupal 6.3 and I have the cache turned on. I also have in my template a no-cache meta tag. I don't think this is a browser problem. Here's what I do:

I try to log out, but it returns me to the same page showing me still logged in. If I go to a page that I have not visited for a while, it will show me as logged out.

I think it's just Drupal returning cached pages when it shouldn't be.

#45

matt@antinomia - August 19, 2008 - 18:39

FWIW, I'm experiencing the same issue in Drupal 5.10. "Normal" page caching turned on, also using the Logintoboggan module. When I disable either page caching OR logintoboggan and then clear the cache, the problem disappears. Seems to be occurring for multiple users on multiple browsers. I've cleared the sessions table which doesn't seem to help. Running PHP 5.2.5. Also, the problem appeared after moving the site from one domain to another, which may be an important detail.

[EDIT] Also reporting that it's occurring on Safari 3 (XP/OS X), Firefox 3 (XP/OS X) but not IE 7. [/EDIT]

#46

mrMaze - August 19, 2008 - 16:21

Response to #23:

Your link points to a php problem in Drupal 4... Are you saying that this solution is applicable to versions 5 and 6?

#47

henns20 - August 20, 2008 - 04:13

I have been up and down this list and have noticed problems with this "log-out / cache" issue before - but now that I am starting to build production (with clients) websites using Drupal this has become a big concern... A couple of questions/Observations to see if it can be taken off the list of possibilites....

  1. Could it be related it to or caused by the individual themes. Does using Garland solve this problem? I can't recall having this problem using Garland
  2. I have yet to tell my Webhost to change to PHP 5 - caused I don't know what problems that would cause. Would the fact that my server is running PHP 4 vs PHP 5 be the caused of the problem?

I will test these to see if they have anything to do with it. but also looking for feedback.

I should mention that I am using 5.10 and Browsers Camino, Firefox, IE on a Mac OSX

[Edit]
point 2 in my comment i guess can't be the case - per the comment above where problem persists in when using PHP5

Jamie

#48

walker2238 - August 19, 2008 - 19:45

Well I might as well join in here. Thats right the Drupal village idiot... I for one am 99.9% sure (just like a shared servers up time) that this issue is related to performance caching. And like the rest of you I have no clue. And now that I read my post I realize i'm not very helpful. It's only with performance caching enabled that I have this problem. I've been signing in and out for the past hour or so... thats my two cents.

#49

matt@antinomia - August 27, 2008 - 17:40

I worked-around this bug by hooking info the 'logout' $op of hook_user() with a cache_clear_all() as described above, using the following code. Please don't scorn me Drupal gods for working around a bug instead of fixing it!

<?php
function my_module_user($op, &$edit, &$user_edit, $category = NULL) {
  if (
$op == 'logout') {
    global
$base_root;
   
cache_clear_all($base_root .'/', 'cache_page');
  }
}
?>

[EDIT] The above code does seem to improve the situation but does not workaround the bug all of the time. [/EDIT]

#50

henns20 - August 20, 2008 - 04:19

matt@antinomia,

So just to clarify...to use your work around....

  1. You created an arbitrarily named module something like "mymodule.module" with the following code and put it in custom modules folder
  2. sit back and relax

Do you need to create a hook_menu(). Is there any installation of the module... on the modules page? I am just trying to make sense on how Drupal knows to use the code?

Putting just that code in my view header seems to have fixed it for me. I still have cache enabled.

this quote taken from comment#1 - what is meant by view header (header of individual view on front page)? would you put the code there

I second the apology...to the drupal gods

Thanks

Jamie

#51

psynaptic - August 20, 2008 - 07:48

That code should go in a module, in this case my_module.module. You need to create a my_module.info file to tell Drupal about the module. Then it will become available on the modules page.

#52

matt@antinomia - August 20, 2008 - 08:08

@henns20, psynaptic is correct that you also need an .info file to tell Drupal about the module (http://drupal.org/node/82936) and then you enable the module at admin/build/modules. No need to use hook_menu(), which we'd use if we wanted to map a path (URL) to a callback (function). No need to insert the code into the view header (the "header" text area defined in a page "view") if you're using this work-around.

#53

henns20 - August 21, 2008 - 17:46

hey thanks guys - that helps out a lot to clarify - i am suffering from information overload with everything:) so that helped out a lot.

#54

B.P.B - August 24, 2008 - 01:38

I am having the same problem with 5.9. I log out, then when I enter a node, it shows I am still logged in. Then when I try to log out again, it tells me "access denied".

The module by matt@antinomia had no effect. The only way to solve the issue is to clear all private data from FF. Even then, the problem happens all over again during the next logon attempt.

This is a critical error that makes Drupal unusable.

#55

B.P.B - August 24, 2008 - 02:03

Maybe this is related to our hosting? I am using hostgator shared hosting. How about the rest of you?

#56

watbe - August 24, 2008 - 02:06

quite sure its not because of hosting provider, as this has not happened to any of my other sites on the same host.

But anyway, my host is iWeb .

#57

pramudya81 - August 24, 2008 - 13:27

I guess it is something to do with our internet connection.

Using dial up connection, this issue not arises.
In my office using LAN shared broadband connection, this issue not arises.

Only arises when I use my 3.5G mobile UMTS connection.

Regards

#58

henns20 - August 27, 2008 - 14:01

Ya the module did not work so well for me either - it seems like it helped get me out of "loop" faster, but did not fix the problem. Does anyone think that panels is the problem. How many of the people are using panels 2 - I am actually using Panels on the frontpage - i just have this feeling that could be the problem - haven't qualified why - but empirically i think it is a problem. I would agree that with this

This is a critical error that makes Drupal unusable.

but i would add..." on production sites."

Jamie

[edit]
I was doing some testing last night and it seems when disabled panels 2. I was not having this problem. Specifically, I have a strong feeling that the panels 2 beta 3...when i use the panels as the frontpage (site information-->default frontpage as a panels page)...this problem is very noticable

#59

luckyday13 - September 3, 2008 - 16:54

I don't have much to add, but I wanted to subscribe. For me, my user logout issue became a major problem once I updated from 5.9 to 5.10 over the weekend. I also upgraded a number of other modules at that time as well, but I would not suspect any of them as likely culprits. I can repeat the logout cache error on any browser and my current work around for my users has been to disable the cache (had been set to normal) after reading many of the posts here.

 
 

Drupal is a registered trademark of Dries Buytaert.