Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

How to rename "cspm" cookie name

Dear Experts,

I am looking for some assistance to change the name of cookie which is being injected by F5 (AVR) to collect page load time:

Below is the default cookie name, F5 sends in the response.

Set-Cookie: f5_cspm=1234;

I would like to modify the name of the cookie and will encrypt as well for security reason.

I did some research and found that it is possible to rename it but could not find an article regarding how to rename it.

https://cdn.f5.com/product/bugtracker/ID608242.html

Any suggestions will be highly appreciated.

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Running a 'tmsh list sys db ' command for avr.cspmcachecookiename gives the following output:

[root@bigip81:Active:Standalone] config # tmsh list sys db avr.cspmcachecookiename
sys db avr.cspmcachecookiename {
    value "f5_cspm"
}

From that, the command to change the cookie name would be 'tmsh modify sys db avr.cspmcachecookiename value "your_preferred_cookie_name".

0
Comments on this Answer
Comment made 1 month ago by Fozail 226

Hi,

Thank you for the valuable input.

Once I modify the value for the cookie, do I need to modify somehow the JS which is being injected by F5 as it reference the default value.

<script id="f5_cspm">(function(){var f5_cspm={f5_p:'OPDANPKLIJGIONLOIJAGOGPGAOHNPIFIADIKOFMNJCPINPCLCMEOLCBDCFIJPGDINFOMEIHOFNGBJBGBBCPAKPHLNLNACAKDAAHPADMIINGINEJCAACNBGBDKKIGMBBJ',setCharAt:function(str,index,chr){if(index&gt;str.length-1)return str;return str.substr(0,index)+chr+str.substr(index+1);},get_byte:function(str,i){var s=(i/16)|0;i=(i&amp;15);s=s<em>32;return((str.charCodeAt(i+16+s)-65)&lt;&lt;4)|(str.charCodeAt(i+s)-65);},set_byte:function(str,i,b){var s=(i/16)|0;i=(i&amp;15);s=s</em>32;str=f5_cspm.setCharAt(str,(i+16+s),String.fromCharCode((b&gt;&gt;4)+65));str=f5_cspm.setCharAt(str,(i+s),String.fromCharCode((b&amp;15)+65));return str;},set_latency:function(str,latency){latency=latency&0xffff;str=f5_cspm.set_byte(str,48,(latency&gt;&gt;8));str=f5_cspm.set_byte(str,49,(latency&amp;0xff));str=f5_cspm.set_byte(str,43,2);return str;},wait_perf_data:function(){try{var wp=window.performance.timing;if(wp.loadEventEnd&gt;0){var res=wp.loadEventEnd-wp.navigationStart;if(res&lt;60001){var cookie_val=f5_cspm.set_latency(f5_cspm.f5_p,res);window.document.cookie='f5avr1136691605aaaaaaaaaaaaaaaa='+encodeURIComponent(cookie_val)+';path=/';} return;}} catch(err){return;} setTimeout(f5_cspm.wait_perf_data,100);return;},go:function(){var chunk=window.document.cookie.split(/\s<em>;\s<em>/);for(var i=0;i&lt;chunk.length;++i){var pair=chunk[i].split(/\s</em>=\s</em>/);if(pair[0]=='f5_cspm'&amp;&amp;pair[1]=='1234') {var d=new Date();d.setTime(d.getTime()-1000);window.document.cookie='f5_cspm=;expires='+d.toUTCString()+';path=/;';setTimeout(f5_cspm.wait_perf_data,100);}}}} f5_cspm.go();}());</script>

0