Collapsiblock cookie use triggers logouts in IE

gracearoha - April 26, 2007 - 07:04
Project:Javascript Tools
Version:5.x-0.6
Component:Jstools core
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

Help! When i enable js tools and try to go to a page (any page) i receive the message that i am not authorized to view the page and i am automatically logged out and cannot log back in.

I am using Drupal 5.1 and garland. Any ideas?

#1

heimstein - May 1, 2007 - 18:07
Title:Help! Js Tools locks me out of my site» in jquery.cookie.js the function jQuery.cookie is the reason!
Component:Tabs» Jstools core
Category:support request» bug report

hello gracearoha,
dear maintainers,

imho, this is an critical BUG. klaus hartl's jQuery.cookie (or improper usage of that function) is messing things up in a horrible way. so here's my story:
- update from jstools-0.3 to 0.6 on 2007-04-28
- first impression: fine! (i am mostly using FF2, not IE. did only sporadic checks with IE)
- yesterday: was logged out without reason (somehow the session-cookie didn't work anymore)
- unwanted logout happens reproduceable in IE7 after "some" clicks araound the my site (where "some" is an integer between 1 an 10)
- it happens never in IE6
- and only occasionally(!) in FF2 (puuuhh!)
- caused me a lot of headache and a night without sleep... (i updated a lot of modules in the last time and hacked many, so i had to search the entire site for recent changes)
- after many, many hours of investigation, i detected that the update of jstools is the reason
- found in jquery.cookie.js approx. line 72. commented out the line.

        var domain = options.domain ? '; domain=' + options.domain : '';
        var secure = options.secure ? '; secure' : '';
//////////////////////////////////////////////
//        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
//////////////////////////////////////////////
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {

this unfortunately deactivates the (very nice!!) persistence of collapsible-block's state, but stops those unacceptable logouts for me.

#2

nedjo - May 1, 2007 - 18:14

Thanks for the note.

This error may be addressed in the latest version of the cookie plugin. But that version may not work with Drupal jQuery. Anyone have time to check into this?

#3

heimstein - May 1, 2007 - 18:41
Title:in jquery.cookie.js the function jQuery.cookie is the reason!» logged out without reason!

just changed the title of that issue...

#4

gracearoha - May 15, 2007 - 03:10

Anything new happening on this issue?

#5

nedjo - May 15, 2007 - 03:43

I'm hoping someone - e.g., one of you who are reporting this issue - will do the small amount of legwork to test the latest version of the library and see if it solves this issue without raising new ones. In other words, that "something new happening on this issue" could be you!

http://jqueryjs.googlecode.com/svn/trunk/plugins/cookie/

#6

dmarble - June 18, 2007 - 04:46

Friends, this is my first contribution since diving into Drupal. I hated Drupal for a number of hours today before finding this thread which pointed me to jquery.cookie.js.

My solution, which so far seems to fix the random logouts I was having on IE 7, is to explicitly declare the path instead of leaving it out by default.

In jquery.cookie.js (either the version that comes w/ jstools or the latest pointed to by nedjo), change:

     var path = options.path ? '; path=' + options.path : '';

to the following:
     var path = options.path ? '; path=' + options.path : '; path=/';

#7

skorch - June 19, 2007 - 12:36

I've got users reporting the same problem with IE (new and old versions). It seems to only happen during node edits/creation or adding comments. Typically when you get to the edit screen (vs submit).

I applied dmarble's patch but it didn't help for me. It got me to the edit screen, but I was logged out upon submit.

For me, the guilty module is the Collapsiblock. Once this was disabled, I had no problems.
Currently active JSTools modules:
ActiveMenu
AJAX Submit
DynamicLoad
JSCalendar
JSTools

#8

csc4 - June 29, 2007 - 12:54

Tracking - I have users with this problem too.

#9

nedjo - August 5, 2007 - 15:50
Status:active» needs review

So we've tracked the problem down to the jQuery cookie extension and more specifically to its path option. So far so good.

Setting the path to '/' works for some people but not for others.

It looks like we need to feed in the base path. Here's an untested patch to do so.

Please test and report back.

AttachmentSize
collapsiblock-cookie.patch 1.01 KB

#10

nedjo - August 5, 2007 - 15:52
Title:logged out without reason!» Collapsiblock cookie use triggers logouts in IE

More descriptive title.

#11

nedjo - August 8, 2007 - 20:22
Status:needs review» fixed

I've applied the patch. Please reopen this issue if that didn't fix it.

#12

Anonymous - August 22, 2007 - 20:33
Status:fixed» closed

#13

Rhino25782 - September 7, 2007 - 12:09
Status:closed» active

I have the patch applied but the problem persists that IE users get logged out invariably.

#14

kYuZzZz - December 10, 2008 - 17:35

maybe the maximum number of cookies has been exceeded.
so the older cookie (usually PHPSESSID) has been deleted and then automatically re-created.

I'm not definitely sure, but this issue could be related to how drupal manages the collapsed-state of the blocks. too many cookies per single domain are a problem.

#15

kYuZzZz - December 12, 2008 - 15:38

I have opened this issue http://drupal.org/node/345684 about this.

 
 

Drupal is a registered trademark of Dries Buytaert.