Webhook with SessionID

This is how I ended up handling SessionID (like a real server would).

There is no need to handle session ids manually, since the common way of setting the session cookie is used. A browser receives it, stores it for the website and will send it automatically next time. (Like any website would.)

  1. “Make it have a SessionID” gets the session id from the cookie. And stores it in sessionId
  2. Simple memory gets it from $json.sessionId
  3. Response sets the correct session header to return it

Just the session function code here: js - parse cookie header for session id · GitHub

Based on:

Long version, based on the community post:

1 Like

The Respond node creates a Browser-Session restricted sessionId. (will be removed when reloading the page).

To make it stay, change the respond node Value to:

SESSID_VueEngine={{ encodeURIComponent($('Make it have a SessionID').item.json.sessionId)  ?? '' }}; expires={{ (new Date(Date.now() + 1*24*60*60*1000)).toUTCString() }}; path=/;
  • adding Expire Date and Path