Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread cookie
Fri, Jun 19 2015 5:40 AMPermanent Link

Ronald

Hi,

I am trying to write a cookie that is not session only with:

Cookies.Set('cursus',cbActive.Value,6000,'/','localhost',false);

That works fine until I close the browser. I presumed that the MaxAge
parameter defines the lifetime in seconds.

What am I not understanding?

Greetings,
Ronald

Fri, Jun 19 2015 6:04 AMPermanent Link

Matthew Jones

Ronald wrote:

> That works fine until I close the browser. I presumed that the MaxAge
> parameter defines the lifetime in seconds.

Hmm, the framework code is like this:

  if (MaxAge >= 0) then
     TempCookie:=(TempCookie+'; max-age='+IntToStr(MaxAge*24*60*60));

which implies days I think? So it should still be there. I'd ponder if
you need the domain, given it is specific to the computer, but I've not
used cookies (I use localstorage). But you are down to the normal
javascript cookie use here, so pages like this will give lots of clues:

http://stackoverflow.com/questions/1458724/how-to-set-unset-cookie-with-jquery

--

Matthew Jones
Fri, Jun 19 2015 9:55 AMPermanent Link

Ronald

The problem could indeed be in the MaxAge in the manual it says:

....the MaxAge parameter specifies the length of time, in seconds..

But I have not tested it, because you gave me a good idea (as usual) about
the localstorage. I tried that and it works great.


"Matthew Jones"  schreef in bericht
news:82C2AF96-48EF-4596-B977-463A16D39157@news.elevatesoft.com...

Ronald wrote:

> That works fine until I close the browser. I presumed that the MaxAge
> parameter defines the lifetime in seconds.

Hmm, the framework code is like this:

  if (MaxAge >= 0) then
     TempCookie:=(TempCookie+'; max-age='+IntToStr(MaxAge*24*60*60));

which implies days I think? So it should still be there. I'd ponder if
you need the domain, given it is specific to the computer, but I've not
used cookies (I use localstorage). But you are down to the normal
javascript cookie use here, so pages like this will give lots of clues:

http://stackoverflow.com/questions/1458724/how-to-set-unset-cookie-with-jquery

--

Matthew Jones
Sat, Jun 20 2015 7:29 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< which implies days I think? >>

Yeah, that's a bug - I've changed it in both EWB 1.x and 2 and will have a
new EWB 1.x build out after 2 is released on Monday.

Tim Young
Elevate Software
www.elevatesoft.com
Image