Opened 8 years ago

Closed 8 years ago

#15088 closed defect (fixed)

dijit/Tree creates 'undefined' cookie by default

Reported by: Adam Peller Owned by: bill
Priority: undecided Milestone: 1.8
Component: Dijit Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

Trees with persist:true (the default) but without an id or cookieName will persist state in a cookie called 'undefined'. This can be seen by simply running the themeTester. There are two trees, both persist their state. If you examine document.cookie you'll see

>>> document.cookie
"undefined=continentRoot; rootlessTreeSaveStateCookie=continentRoot"

Change History (3)

comment:1 Changed 8 years ago by Adam Peller

Not sure whether to recommend that the state not be persisted at all without an id, or whether a generated id should be used. The latter is questionable. If the entity is not named, it's probably not going to be used.

In retrospect (perhaps my bad) it probably would have also been better to use shorter names and have persist:false by default, since it's not hard to hit the HTTP 4k cookie limit with a couple of large open Tree widgets.

comment:2 Changed 8 years ago by bill

Milestone: tbd1.8
Owner: set to bill
Status: newassigned

I thought I fixed this in #12735. Guess I messed it up and should have been checking this.params.id not this.id, which can be auto-generated. (Although I don't know where that undefined is coming from, since as I said every Tree should have an auto-generated id.)

comment:3 Changed 8 years ago by bill

Resolution: fixed
Status: assignedclosed

In [28254]:

Don't try to save tree state if cookieName is undefined (which happens when there's no user specified id). Fixes #15088, refs #12735 !strict.

Note: See TracTickets for help on using tickets.