I've been searching for some JavaScript functions that would provide some sort of friendly interface to browser cookies, like setCookie(name, value, expireDays)
and getCookie(name)
, but the top results Google brings up are related to code that is either considerably old and got no usage experience comments on it (quirksmode.org), desperately buggy (w3schools.com), used to contain serious bugs undiscovered for years (techpatterns.com), or only gives you one half of the answer (stackoverflow.com on its page at Javascript getCookie functions).
So the question is: after all the time cookies and JavaScript have been in touch, what functions would you suggest to be the most reliable ones when it comes to writing and reading browser cookies?