CookieLaw

Erweiterungen
Post Reply
Doc
Posts: 30
Joined: Fri 25. Dec 2015, 09:20

CookieLaw

Post by Doc » Tue 26. Jan 2021, 10:38

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":"")

Gert
Posts: 1505
Joined: Sun 18. Nov 2012, 14:18

Re: CookieLaw

Post by Gert » Tue 26. Jan 2021, 15:02

Hello,

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

Gert
Gert Ebersbach | CMSimple | Templates - Plugins - Services

Doc
Posts: 30
Joined: Fri 25. Dec 2015, 09:20

Re: CookieLaw

Post by Doc » Wed 27. Jan 2021, 07:23

This is by using the development tools built into Firefox.
This is an https connection.

Gert
Posts: 1505
Joined: Sun 18. Nov 2012, 14:18

Re: CookieLaw

Post by Gert » Wed 27. Jan 2021, 12:26

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
Gert Ebersbach | CMSimple | Templates - Plugins - Services

Doc
Posts: 30
Joined: Fri 25. Dec 2015, 09:20

Re: CookieLaw

Post by Doc » Wed 27. Jan 2021, 13:49

Thank you, I can't find the warning.
Daniel.

Post Reply