title: Null ServerSession on CometD /meta/handshake
body: <p>Section <a href="http://docs.cometd.org/reference/concepts_low_level.html#concepts_message_processing" rel="nofollow">6.3.6.4</a> and the bottom of section <a href="http://docs.cometd.org/reference/javascript_handshake.html" rel="nofollow">7.2</a> of the CometD documentation discuss how to establish a Listener on the /meta/handshake channel to map user IDs to ServerSessions/ServerSession IDs for use in private messaging. However, when listening on the /meta/handshake channel, the ServerSession received is null, so there is no way to create the map. Any thoughts?</p>
  
  <p>UPDATE:</p>
  
  <p>My assumption at this point is that the HandshakeHandler Listener (added to the /meta/handshake channel in the initializeMetaChannels method of BayeuxServerImpl.java) is getting invoked after or at the same time as the custom Listener that I have created on the same channel. Since the HandshakeHandler is what actually creates the ServerSession, this results in my custom Listener receiving a null ServerSession. This is supported by the fact that the BayeuxServer SecurityPolicy's canHandshake method, which gets invoked by the HandshakeHandler after it creates the ServerSession, is getting invoked <em>after</em> my custom listener. I presume that the CometD documentation stating that a ServerSession to UserID map can be constructed from within a /meta/handshake Listener is in error.</p>