Cross session issue with Express 3 Cross session issue with Express 3 express express

Cross session issue with Express 3


Oh good god I figured it out after a looooot of debugging. The issues are twofold:

  • The MailChimpAPI module has a bug - when an error is received it creates this code:

    error = new Error(message || (message = ''));

The error var is undeclared so it's hitting the global error var.

  • The view code checks if 'error' exists and prints it - that was my own variable. But apparently in the inner mechanism of Express it checks for the global error var.

It seems that error is being handled as an app.locals variable hence bridging user sessions.

I am fixing it by a) patching the MailChimp helper code and filing a bug report and b) making sure to not use 'error' as a view variable ever again.

Woah.