title: store data in asp.net with signalr
body: <p>I am trying to store data in asp.net application with signalr. To ilustrate my problem here is example.</p>
  
  <p>I have a hub that informs controll that user has connected and sends his id.</p>
  
  <pre><code>public static event EventHandler&lt;IdEventArgs&gt; userConnected;
  
  public void Connected()
  {
      Debug.WriteLine("Hub Connected Method");
      var id = Context.ConnectionId;
  
      userConnected(this, new IdEventArgs(id));
  }
  </code></pre>
  
  <p>Then I have my controller that adds event handler to hub</p>
  
  <pre><code>    public ActionResult Index()
      {
          LoadingHub.userConnected += new EventHandler&lt;IdEventArgs&gt;(UserConnected);
  
          return View();
      }
  </code></pre>
  
  <p>And finally my method that should save the obtained data</p>
  
  <pre><code>    private void UserConnected(object sender, IdEventArgs e)
      {
          Debug.WriteLine("User Connected with Id: " + e.Id);
  
          //To do:
          //save data
      }
  </code></pre>
  
  <p>I tryed saving to Session but Session object is null here. I came across user profiles and maybe this would be a good solution - is it possible to create new profile when user connects to store data inside, and when he disconects to destroy said profile? Or maybe completly diffrent approach is more siutable here?</p>