iCookieDuration

iCookieDuration

LightningCodeLightningCode Posts: 3Questions: 0Answers: 0
edited August 2012 in General
Hi, and first off let me thank you for a very nice free package.

We're using v1.8.2, which is unlikely to change for a while at least. I see you've done a good bit of work on the persistence front, but for now the cookie solution is working fine for us. I posted this in "General" since the same persistence scheme is one of the options in 1.9.x.

My question is in regards to the default timeout of 7200 seconds (2 hr). Is it in fact the case that unless the user changes a setting, resetting the cookie, that the table will return to the default settings after 2 hours (or certainly overnight, correct?)?

I realize we can set our own timeout using iCookieDuration, so we'll use that as a workaround. I'm curious what use case prompted that default, as it seems to me that in most cases users would find such behaviour disconcerting.

Replies

  • LightningCodeLightningCode Posts: 3Questions: 0Answers: 0
    As a quick followup to save others some potential testing/debugging time, the persistent settings do reset after two hours of non-use. At least for our application, the cookie is refreshed each time the page is loaded, which could confuse things further. The most likely outcome is the user returning the next day to find the UI is back to the default.

    iCookieDuration works fine to change the default timeout. We've now got ten years set as our persistence timeout.
  • LightningCodeLightningCode Posts: 3Questions: 0Answers: 0
    By the way, is there any chance of this default being changed to something more like a year (or more) in a future release? :-)

    I just don't see a short default making sense in any real use case.
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    > Is it in fact the case that unless the user changes a setting, resetting the cookie, that the table will return to the default settings after 2 hours (or certainly overnight, correct?)?

    Bob on.

    > By the way, is there any chance of this default being changed to something more like a year (or more) in a future release? :-)

    Not likely to change the default unless there is a _very_ compelling reason to do so (i.e. a bug). You can use the ability to set defaults ( http://datatables.net/release-datatables/examples/advanced_init/defaults.html ) to set your own, but changing something that is already int he wild, that other developers might rely upon would be bad.

    The reason for the short duration is because DataTables is specifically designed for enhancing tabular data (i.e. statistics etc), and I felt it likely that if you hadn't been on such a page after about 2 hours you would want it to reset back to the start. Useful in some cases, not in others, that's why the default can be configured :-).

    Allan
This discussion has been closed.