def response_cookies_deep_copy():
 raw_headers = parse.remote_response.raw._original_response.headers._headers
 header_cookies_string_list = []
 for (name, value) in raw_headers:
  if (name.lower() == 'set-cookie'):
   if (my_host_scheme == 'http://'):
    value = value.replace('Secure;', '')
    value = value.replace(';Secure', ';')
    value = value.replace('; Secure', ';')
   if ('httponly' in value.lower()):
    if enable_aggressive_cookies_path_rewrite:
     value = regex_cookie_path_rewriter.sub('path=/;', value)
    elif (enable_aggressive_cookies_path_rewrite is not None):
     if (parse.remote_domain not in domain_alias_to_target_set):
      value = regex_cookie_path_rewriter.sub((('\\g<prefix>=/extdomains/' + parse.remote_domain) + '\\g<path>'), value)
   header_cookies_string_list.append(value)
 return header_cookies_string_list

def response_cookies_deep_copy ( ) : raw_headers = parse . remote_response . raw . _original_response . headers . _headers header_cookies_string_list = [ ] for ( name , value ) in raw_headers : if ( name . lower ( ) == 'set-cookie' ) : if ( my_host_scheme == 'http://' ) : value = value . replace ( 'Secure;' , '' ) value = value . replace ( ';Secure' , ';' ) value = value . replace ( '; Secure' , ';' ) if ( 'httponly' in value . lower ( ) ) : if enable_aggressive_cookies_path_rewrite : value = regex_cookie_path_rewriter . sub ( 'path=/;' , value ) elif ( enable_aggressive_cookies_path_rewrite is not None ) : if ( parse . remote_domain not in domain_alias_to_target_set ) : value = regex_cookie_path_rewriter . sub ( ( ( '\\g<prefix>=/extdomains/' + parse . remote_domain ) + '\\g<path>' ) , value ) header_cookies_string_list . append ( value ) return header_cookies_string_list
its a bad hack to get raw cookies headers .