One query causes 3 connections on socket.io

When a user visits a webpage, node.js fires up the io.sockets.on("connection", ..) event three times. I'd like to avoid this because it performs a SQL query, and I don't want to do it 3 times per visitor.

One of it seems to be my client side JS - I commented out all except the socket.io connection line in the client JS, and I still see 2 connection events fired in node.js.

What could be the cause?