0

What's the most compact way to set a never expiring (almost never) cookie?

I came up with:

function infiniteCookie(n,v){document.cookie=escape(n+"="+v)+";expires=Fri, 31 Dec 9999 23:59:59 GMT;path=/";}

Is there maybe an even more compacter / compressed way to do it?

  • possible duplicate of [how to set this cookie to never expire](http://stackoverflow.com/questions/10641737/how-to-set-this-cookie-to-never-expire) – LcSalazar Feb 10 '15 at 20:55
  • @LcSalazar Impossible. –  Feb 10 '15 at 20:56
  • 1
    Seems to be the most compact way. FYI, a cookie can never "not expire", but just expire at a really far away date (how you set it) – rageandqq Feb 10 '15 at 20:56

0 Answers0