This site is no longer updated.Go to new Conversational Cloud docs

function stopSession()


The $jsapi.stopSession() method ends the session.

The contents of the $session are cleared immediately when you call up the method. The new question of the user and the bot’s response go to the previous session. Subsequent queries are recorded to the new session.


How to use

theme: /

    state: Greeting
        q!: * *start
        q!: (hello|hello) *
        script:
            $jsapi.startSession();
        a: Hello! How can I help you?

    state: Goodbye
        q!: (bye|goodbye|bye) *
        script:
            $jsapi.stopSession();
        random:
            a: Have a good day.
            a: Goodbye!