title: How to make a permanent session on DialogFlow?
body: <p><strong>I imagine that to do this I need, somehow, to save the contexts in a DB and return them when requested. In another topic here on Stackoverflow, I found this code below, but when implementing it an error is returned.</strong></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// request to dialogflow detect intent
  const request = {
        session: session,
        queryInput: {
                    input
        },
        context:"last received context from dialogflow" //recent context from db
      }; 
      detectIntent(request).then(response=&gt;{
      const context = response.context; //response context
      db.save(context); // save this in db
      return response;
  });</code></pre>
  </div>
  </div>
  </p>