Opened 10 years ago
Closed 10 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 10 years ago by
comment:2 Changed 10 years ago by
Milestone: | tbd → 1.8 |
---|---|
Owner: | set to bill |
Status: | new → assigned |
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.)
Note: See
TracTickets for help on using
tickets.
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.