@@ -18,7 +18,9 @@ function IoRequest(socket, io, data, response) {
   }
 
   this.session = socket.session;
-  this.handshake = socket.session.handshake;
+  if (socket.session) {
+    this.handshake = socket.session.handshake;
+  }
 
   this.response = response;
 