• Resolved tcdigital

    (@tcdigital)


    When using the chatbot shortcode [mwai_chatbot id=”default”] I always get the following error when submitting a message:

    “Your session has expired. Please refresh the page to continue using AI Engine.”

    The floating chatbot widget works fine. Has something changed?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Val Meow

    (@valwa)

    Hey @tcdigital! 👋

    Without more details it is hard to tell what could be the root of the issue. Could you link a page where this can be experienced?

    Also make sure this is not related to any cache or optimization plugin you might have running. Make sure to disable any such plugin temporarily to see if this helps.

    Thread Starter tcdigital

    (@tcdigital)

    The issue seems to be with the way this plugin build URLs:

    When the page is using translatepress with a default language directory (and maybe any similar multilingual plugin), the rest URL that is being built is

    https://example.org/de_de/wp-json/mwai/v1/start_session

    This works fine for GET, because GET requests get redirected. But POST doesn’t allow redirects. Therefore, no session can be started.

    Or is this an issue with Translatepress itself?

    Thread Starter tcdigital

    (@tcdigital)

    Solved using the following functions.php snippet where /de/ is my default language. This still seems like a dirty hack so I would be interested if this is something that can be addressed by either AI Engine or Translatepress.

    add_filter(‘rest_url’, function ($url, $path, $blog_id, $scheme) {
    if ($path === “/”) {
    $url = str_replace(‘/de/’, ‘/’, $url);
    }return $url;
    }, 99999999, 4);

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.