How to authenticate user session from another server?

This is the use-case:

  1. server A authenticate the user and creates a session for the user.
  2. The user wants to communicate with server B.
  3. server B needs to authenticate the user before the user can proceed.

My Question:
How should server B authenticate the user?

Note: server A is a node.js, express server B is socket.io dedicated server.

Just use one of the many non-in-memory session stores. Some example session store Express/Connect middleware include:

If you are creating a SPA (e.g. with angular.js), you could also use tokens (e.g. JWT) instead of using cookies to track sessions.