title: Two express servers - log out from one should log out from the second (express-session with a Postgres store)
body: <p>I have two express servers, one is used for a website, with standard HTTP routes, while the other is an application hosted on the website, which uses WebSockets.</p>
  
  <p>The website has specific parts of it which require to be logged in, while the application always requires to be logged in.</p>
  
  <p>The website server is the one handling logging in and out.</p>
  
  <p>The reason they are separate is mostly for code cleanness, I am not sure if there's really a reason to do this or not.</p>
  
  <p>Either way, once a user is logged in and is in the application, the user can then log out of the site, and yet stay logged into the application, since there isn't any inherent connection between the two.</p>
  
  <p>A solution I thought of was to use Postgres' NOTIFY functionality, to let the website communicate with the application when users log in and out, but this seems a bit hacky.</p>
  
  <p>Is there a better way to handle such cases? is NOTIFY fine? And really, is there an actual reason to spread the functionality over multiple express servers? (for example, I have yet another server that handles API requests for the application)</p>