Page 1 of 1

CookieLaw

Posted: Tue 26. Jan 2021, 10:38
by Doc
Hello, I have this warning message:
The "PHPSESSID" cookie will be released soon because its "SameSite" attribute is set to "None" or an invalid value and it was not the "secure" attribute. To learn more about the "SameSite" attribute. To learn more about the "SameSite" attribute developer mozilla (French)
Do you have a fix?

Source : /plugins/cookielaw/source/cookielawhint.js

Code: Select all

case String:a="; expires="+i;break;case Date:a="; expires="+i.toUTCString()}return o.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+a+(s?"; domain="+s:"")+(n?"; path="+n:"")+(r?"; secure":"")

Re: CookieLaw

Posted: Tue 26. Jan 2021, 15:02
by Gert
Hello,

sorry - I can not reproduce it, because I do not get such a message. Is it a https connection?

Gert

Re: CookieLaw

Posted: Wed 27. Jan 2021, 07:23
by Doc
This is by using the development tools built into Firefox.
This is an https connection.

Re: CookieLaw

Posted: Wed 27. Jan 2021, 12:26
by Gert
Hello,

please try following, cookielawhint.js line 37ff:

Code: Select all

...

s=
{
get:function(e){return decodeURIComponent(o.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null},
set:function(e,t,i,n,s,r)
{
if(!e||/^(?:expires|max\-age|path|domain|httponly|samesite|secure)$/i.test(e))return!1;
var a="";if(i)switch(i.constructor){case Number:a=1/0===i?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+i;break;
case String:a="; expires="+i;break;case Date:a="; expires="+i.toUTCString()}return o.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+a+(s?"; domain="+s:"")+(n?"; path="+n:"")+(r?"; httponly; SameSite=Strict; secure":""),!0
},

has:function(e){return new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(o.cookie)},
remove:function(e,t,i){return e&&this.has(e)?(o.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(i?"; domain="+i:"")+(t?"; path="+t:""),!0):!1}
},

...
The same in cookielawforce.js.

The plugin works for me with the changes, but I do not know, if the warning is gone. Could you please test it and give some feedback?

Gert

Re: CookieLaw

Posted: Wed 27. Jan 2021, 13:49
by Doc
Thank you, I can't find the warning.
Daniel.