Optionally use session cookies for state saves

Optionally use session cookies for state saves

somtwosomtwo Posts: 2Questions: 0Answers: 0
edited June 2012 in Feature requests
Hi,
DataTables currently only supports cookies expiring based on a time period, but it would be nice to be able to use session cookies that would go away when the browser is closed. I've looked into it, and it would be a trivial modification to support this (one extra bool option and a few small branches inside _fnCreateCookie) and I could probably make the changes myself and send diffs if that would be helpful.

Thanks

Replies

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    DataTables provides the fnStateLoad and fnStateSave callbacks (among others) which allows complete customisation of the state saving. For example in this blog post - http://datatables.net/blog/localStorage_for_state_saving - I detail how localStorage can be used in preference to cookies.

    With DataTables moving to an increasingly modular architecture ( http://datatables.net/development/roadmap ) I'd suggest taking a similar approach for alternative state saving methods - but certainly diffs are very welcome to see your approach!

    Allan
  • somtwosomtwo Posts: 2Questions: 0Answers: 0
    Actually, I just found the fnCookieCallback option. I can just use that to generate a session cookie. :)
This discussion has been closed.