It looks like the good news is that the cookie's expiry value is an option to 
the PageEnhancer's CookieStore, so you can override it with something that 
actually works. Here's a sketch:

    var expiry = new Date();
    expiry.setYear(expiry.getYear() + 10);

    fluid.pageEnhancer({
        tocTemplate: "<path to your copy of 
Infusion>/components/tableOfContents/html/TableOfContents.html",
        components: {
            settingsStore: {
                options: {
                    cookie: {
                        expires: expiry.getGMTString()
                    }
                }
            }
         }
    });

How's that for some LISPish bracketing? Lemme know if it works; keep in mind 
that I typed this directly into email, so it may need a bit of tweaking.

Colin

On 2011-11-29, at 2:56 PM, Li, Cindy wrote:

> Good finding, Johnny. Yes, I produced the same behaviour as you did with 
> Colin's computer.
> 
> After digging a bit into the code, seems the bug is a result of our improper 
> default value for the cookie "expiry" attribute, which is blank by default:
> 
> https://github.com/fluid-project/infusion/blob/master/src/webapp/components/uiOptions/js/Store.js#L60
> 
> According to http://www.tutorialspoint.com/javascript/javascript_cookies.htm, 
> which says,
> 
> Expires : The date the cookie will expire. If this is blank, the cookie will 
> expire when the visitor quits the browser.
> 
> So, a blank default apparently is not enough if what we meant is to keep the 
> user-selected settings forever. We probably should consider to have a default 
> expiry date of 50 years from now. :-P
> 
> I've filed a jira for it - http://issues.fluidproject.org/browse/FLUID-4562
> 
> Thanks, Jonny.
> 
> Cindy
> 
> On 2011-11-29, at 2:10 PM, Johnny Taylor wrote:
> 
>> Hey,
>> 
>> So the word on the street is I tripped over a rather significant bug in 
>> uiOptions. On my site <http://abledaccess.com> when I change the display 
>> setting via uiOptions in the latest versions of Safari, Chrome, Opera and 
>> IE, then quit each browser, my settings I set have been reset. Same goes 
>> with your demo across said browsers, as well. I saw on Colin's computer this 
>> behaviour doesn't happen in Firefox, but it happens on my machine in 
>> Firefox, as well. But the reset did happen in Safari, Chrome and Opera on 
>> his computer. 
>> 
>> Johnny
>> _______________________________________________________
>> fluid-work mailing list - [email protected]
>> To unsubscribe, change settings or access archives,
>> see http://lists.idrc.ocad.ca/mailman/listinfo/fluid-work
> 
> _______________________________________________________
> fluid-work mailing list - [email protected]
> To unsubscribe, change settings or access archives,
> see http://lists.idrc.ocad.ca/mailman/listinfo/fluid-work

---
Colin Clark
Technical Lead, Fluid Project
http://fluidproject.org

_______________________________________________________
fluid-work mailing list - [email protected]
To unsubscribe, change settings or access archives,
see http://lists.idrc.ocad.ca/mailman/listinfo/fluid-work

Reply via email to