nl_tokens: Refreshes the GDPR country_code cookie every 6 hours ( like A8C_Analytics wpcom plugin ) .
pl_tokens: function maybeRefreshCountryCodeCookieGdpr ( callback ) { const cookieMaxAgeSeconds = 6 * 60 * 60 ; const cookies = cookie . <mask> ( document . cookie ) ; if ( ! cookies . country_code ) { // cache buster const v = new Date ( ) . getTime ( ) ; request . get ( 'https://public-api.wordpress.com/geo/?v=' + v ) . then ( res => { document . cookie = cookie . serialize ( 'country_code' , res . body . country_short , { path : '/' , maxAge : cookieMaxAgeSeconds , } ) ; callback ( ) ; } ) . catch ( err => { document . cookie = cookie . serialize ( 'country_code' , 'unknown' , { path : '/' , maxAge : cookieMaxAgeSeconds , } ) ; debug ( 'refreshGeoIpCountryCookieGdpr Error: ' , err ) ; } ) ; return true ; } return false ; }