The problem with session variables

I found the solution.

the file /lib/core/app.js need to little bit correct function:

    regenerateSessionId: function () {
    return new Promise((resolve, reject) => {
      // Save session data VALUES before regeneration (not just reference)
      const oldSessionData = {};
      for (let key in this.req.session) {
        if (key !== 'regenerate' && key !== 'cookie') {
          oldSessionData[key] = this.req.session[key];
        }
      }

      this.req.session.regenerate((err) => {
        if (err) return reject(err);

        // Restore session data from saved values
        for (let key in oldSessionData) {
          this.req.session[key] = oldSessionData[key];
        }

        // IMPORTANT: update Server Connect $_SESSION reference
        this.set('$_SESSION', this.req.session);

        resolve();
      });
    });
  },

This must be added:
// IMPORTANT: update Server Connect $_SESSION reference
this.set('$_SESSION', this.req.session);

and it seems the problem is going away :melting_face:

Please @Teodor include this in the update so the next one doesn't break my site :slight_smile:

What I like about Wappler is that all the code is available and not hidden, so you can understand and fix it—something you don't get with other no-code systems. (Even though Wappler isn't strictly no-code, it still has that advantage.)