guiassemany/stick-to-me

Cookie duration

Closed this issue · 1 comments

Hi there!
I just quickly wanted to ask whether there is a way to set cookie duration once cookies are enabled.

Regards.

Hi @tswolf!

Its possible. I dont have time to make changes to the code right now, but you should do something like this on line 165.

if (settings.cookie == true) {
 cookiehowm++;
 var expiresAt = new Date().toGMTString(); // just an example. You should put here the date to expire.
 document.cookie="ck_stick_visit="+cookiehowm+";expires='+expiresAt+';path=/";
}

Tell me if it helped you!