Since I installed DrupalChat (long polling method enabled) I'm experiencing logout problem to my site.
When I click on logout, "sometimes" I'm not really logged out but still logged-in!
And even when logout works, a simple page refresh will log me in, automatically (sometimes you need to click "refresh" more than once to let the bug occurr)

At the beginning I thought that logout problem was an issue depending on the browser.
(Effectively there is one affecting old browsers with Drupal: http://drupal.org/node/197786 . And there is also a patch for that: http://drupal.org/node/197786#comment-1055633. I tried that patch even if I'm using new browsers (you never know...) but it doesn't work)

So now I think the problem should really lie in DrupalChat.
Maybe a conflict between DrupalChat polling system and Drupal login/logout system.

Any ideas?

Thanks

CommentFileSizeAuthor
#8 drupalchat_poll.txt2.56 KBBbi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mackee’s picture

For me it still not working even though I use the patch. It will log me out, but after pressing refresh many times the issue still happens.

diego.pasc’s picture

Yes you are right neriweaver!
It is not working even with that patch.
I will update the issue content mentioning that the patch is not working.

shiftymic’s picture

I am having this problem too. After logging out, visiting a different publicly viewable page reveals that I am somehow still logged in (not all the time though, just on occasion).

Anyone know the difference between AJAX and long-polling ---- I too am using long-poll, but perhaps using ajax could fix it?

Also -- issue was seen in Chrome -- didn't notice anything in Firefox, so maybe its an issue with the browser?

Much obliged for any leads/help, otherwise this module is great!

Mackee’s picture

To my knowledge ajax is currently not working.

praveen2k4’s picture

I have the same issue. After logout, few clicks on pages linked inside the site will log me back in.

Bbi’s picture

I removed my session in the database, but drupal continues logging me back. Go on searching a solution.

carvalhar’s picture

same problem here.

Bbi’s picture

FileSize
2.56 KB

I just created a patch thats is working for me.

Open the file drupalchat.module and find drupalchat_poll() function.

Add these lines under sleep(3):

//-------------------------------------------------------------------------------------------------------

$checkUnlog="SELECT timestamp FROM sessions WHERE sid='$user->sid' AND uid =0";
$result=db_query($checkUnlog);
$filas = db_affected_rows($result);
if($filas!=0){
$user->uid=0;
exit(1);
}

//--------------------------------------------------------------------------------------------------------

This code detects when the user closed session and prevents the module re-open the session.

I have attached the full function just to replace the drupalchat.module

I hope that will work well on your site.

carvalhar’s picture

i think #8 worked ;)

darklrd’s picture

@hksbrey - Thanks for you contribution. I will review the patch and commit it soon. :-)

diego.pasc’s picture

Just edited the code in drupalchat.module according patch #8 and... it seems to work well!
Thanks a lot community! :)

ps: better just to rewrite a bit the patch according Drupal standards:

$checkUnlog="SELECT timestamp FROM {sessions} WHERE sid='%s' AND uid =0";
$result=db_query($checkUnlog, $user->sid);
$filas = db_affected_rows($result);
if($filas!=0){
	$user->uid=0;
	exit(1);
}
Mackee’s picture

It works!!! Thanks for the great help! =)

I'm just curious, is there any of you experience a site maintenance. On my site drupalchat now works but after a few times of using chat, my site will suddenly goes on maintenance mode. I suspect it's due to high server load, I'm not sure though. But it only happens on my site when I use drupalchat with long polling method.

Any help with this is highly appreciated.

carvalhar’s picture

@neriweaver
i think it should be another issue. But try to install your site at a local copy just to test, if everything works fine it's definitely a server issue.

darklrd’s picture

Status: Active » Fixed

Fixed in 6.x-2.0-beta5.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

The issue has been completely addressed to DrupalChat. (At the beginning I was not sure if the problem was due to DrupalChat or to the browser cache system)

v8powerage’s picture

Issue summary: View changes

im not using polling but iflychat api and I have same issue