0

I have already read other posts but I'm not working on localhost. The code below works on safari ie and firefox but chrome fails. It looks like it is completely ignored. Any suggestion is welcome.

Here is the code.

  document.cookie = "lang="+$('#account_lang').val()+"; path=/; samesite=none;";    
rosia
  • 219
  • 1
  • 2
  • 6

1 Answers1

0

Seems the newer version of each browser does not support this technique.

you should split this string into parts.

   var x = "lang='1'; path='/'; samesite='none';";

 $.each(x.split(";"), function(i,obj)
    {  if(obj !== "")
        document.cookie = obj;     
    });

if you are using jquery then below is the code

Wahaj A Khan
  • 111
  • 4