title: SignalR OnConnected method not firing when multiple users sign in
body: <p>I have been trying to add a real-time notification feature to an MVC website using SignalR. I am using Asp.NET Identity for authentication.</p>
  <p>As I understood from <a href="https://docs.microsoft.com/en-us/aspnet/signalr/overview/guide-to-the-api/handling-connection-lifetime-events#terminology" rel="nofollow noreferrer">SignalR documentation</a> the OnConnected method on Hub class should fire whenever a user logs in.</p>
  <p>So when I came to debug, if I sign the first user, the OnConnected method called properly. However, when I open another browser(eg: Firefox, Microsoft edge ..) and sign in another user, OnConnected is never called.</p>
  <p>My Startup class looks like this:</p>
  <pre><code>[assembly: OwinStartup(typeof(NotificationApp.Startup))]
  namespace NotificationApp
  {
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);
            app.MapSignalR();
        }
    }
  }
  </code></pre>
  <p>Hub class</p>
  <pre><code>namespace NotificationApp
  {    
      [Authorize]
      public class NotificationHub : Hub {
          
          //This gets called for the first logged in user only
          public override Task OnConnected()
          {
              Clients.Client(Context.ConnectionId).connected(Context.ConnectionId);
  
              return base.OnConnected();
          }
  
         public override Task OnDisconnected(bool stopCalled)
          {
              return base.OnDisconnected(stopCalled);
          }
     }
  }
  </code></pre>
  <p>Client code</p>
  <pre><code>
  $(document).ready(function () {
      var notificationHub = $.connection.notificationHub;
      
      //Called for every client properly
      $.connection.hub.start().done(function () {
  
       console.log('Notification hub started');
        
      });
  
   //This gets called for the first logged in user only
   notificationHub.client.connected = function (message) {
  
          console.log('Hello' + message);
      };
  
  });
  </code></pre>