User Log-out Problem
| Project: | Drupal |
| Version: | 6.x-dev |
| Component: | user system |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active (needs more info) |
Jump to:
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
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
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
What sort of internet connection are you on? Satellite by chance?
#4
I'm on verizon cable internet.
#5
The page fixes itself when hitting ctrl+shift+f5 to clear cache and refresh the page.
Firefox 2 and IE7 seem to be affected.
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
Is there any way to only have
<?phpcache_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
Also, I am having this problem with 5.6.
#8
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
#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
I have this exact problem too.
Is there any resolution yet?
#25
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
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
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
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
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
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
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
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
tracking - having same issue seems like
to recreate issue -
Also
Update:
#34
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?
<?phpcache_clear_all($url, 'cache_page');
?>
Thanks
#35
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
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
It happens on Drupal 5.7 too but only for FireFox. IE performs well.
Regards
#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
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
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
subscribing
#42
having this problem with 5.9
#43
@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
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
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
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
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....
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
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
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!
<?phpfunction 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
matt@antinomia,
So just to clarify...to use your work around....
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?
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
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
@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
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
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
Maybe this is related to our hosting? I am using hostgator shared hosting. How about the rest of you?
#56
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
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
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
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
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.