Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #39241

string function doesn't have array functions

Newsgroups comp.lang.javascript
Date 2020-12-07 07:54 -0800
Message-ID <6cf898b5-74a5-43fa-b382-e765287d65d2n@googlegroups.com> (permalink)
Subject string function doesn't have array functions
From JRough <janis.rough@gmail.com>

Show all headers | View raw


In headers the xsrf token is getting corrupted so I need to hard code the xsrf token till its fixed. My script works to split the key and the value, but can't write over the old generated token value with the  new hard coded value back in the result array. The output array is the same as the  input string ???Do you have any ideas?
let cookieData = 'SSOD-SAT=AFX1AAAAYABvr;s_cc=true;TLTSID=F4FAF40;XSRF-TOKEN=D9CF17822CDCA3D8337DE8F4485EA912';
function writeCookie(cookieData){
	var cd= [];
	    cd = cookieData.split(";");
	var kvPairs;
	var result =[];

  for(kvPairs of cd){
    let kv = [];
        kv = kvPairs.split("=");
    let key = kv[0];
    let value = kv[1];
   console.log("key :"  + key);
   console.log("value:" + value);
        if(key ===('XSRF-Token')){
           value = '000123456';
        }
           result = result + key +"=" +value +";";

    }
    console.log("The result is:"+ result);
}
writeCookie(cookieData);

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

string function doesn't have array functions JRough <janis.rough@gmail.com> - 2020-12-07 07:54 -0800
  Re: string function doesn't have array functions Julio Di Egidio <julio@diegidio.name> - 2020-12-07 08:30 -0800
    Re: string function doesn't have array functions JRough <janis.rough@gmail.com> - 2020-12-07 09:15 -0800
      Re: string function doesn't have array functions "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-12-07 10:06 -0800
        Re: string function doesn't have array functions JRough <janis.rough@gmail.com> - 2020-12-07 10:28 -0800
          Re: string function doesn't have array functions "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-12-07 11:33 -0800
            Re: string function doesn't have array functions Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2020-12-07 23:35 +0100
              Re: string function doesn't have array functions "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-12-07 14:36 -0800
              Re: string function doesn't have array functions JRough <janis.rough@gmail.com> - 2020-12-07 15:29 -0800
  Re: string function doesn't have array functions "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-12-07 09:53 -0800

csiph-web