• I use WP Mautic form integrator. But in anonymous mode cookies are not retrieving to a user.

    I have found next code in a plugin.

    function _push_mautic_form( $query, $formId )
    {
    if( is_array( $query ) && ! empty( $query ) && is_numeric( $formId ) ) {
    $ip = _get_ip();
    $query[‘return’] = get_home_url();
    $query[‘formId’] = $formId;

    $data = array(
    ‘mauticform’ => $query,
    );

    $MauticBaseURL = get_option( ‘haw_mautic_base_url’ );
    if ( $MauticBaseURL ) {
    $url = $MauticBaseURL . “/form/submit?formId=” . $formId;
    $response = wp_remote_post(
    $url,
    array(
    ‘method’ => ‘POST’,
    ‘timeout’ => 45,
    ‘headers’ => array(
    ‘X-Forwarded-For’ => $ip,
    ),
    ‘body’ => $data,
    ‘cookies’ => array()
    )
    );

    if ( is_wp_error( $response ) ) {
    $error_message = $response->get_error_message();
    error_log( “Gform_Mautic Error: $error_message” );
    error_log( “posted url: $url” );
    }
    }
    }
    }

    I think that using an array cookie I can retrieve cookies from Mautic to a user. What should I put into that array to retrieve cookies?

    • This topic was modified 6 years, 9 months ago by voland1493.
  • The topic ‘Retrieving a cookie in private mode.’ is closed to new replies.