Upgrade requests should not save the session. If the session is saved when the WebSocket is closed, all the changes made by normal requests in the time span that goes from the opening of the WebSocket to the close of the same WebSocket are lost.
This is evident when this example page is refreshed in Chrome. For some odd reason the WebSocket request is closed after that the new request has been answered and the session is overriden by the old session that is retained in the old upgrade request.
To make the example work, apply the patch:
patch -p0 < skiponupgrade.patch
Once patched express-session
will not save the session for upgrade requests.