Asp.Net session not working in OnConnected method of Hub class of signalR

529 Views Asked by At

Below is my code.I am trying to get the session values from onConnected method of hub class. But session is not working.It says enable the session first in configuration but this is already enabled

 public override Task OnConnected()
    {
        login log = new login();
        string userId = log.GetUserId();

    }
public string GetUserId()
    {
        return Session["Id"].ToString();
    }

I want to map the user id from my session to connection id of signalR. If any alternative to implement this please suggest Thanks in advance

0

There are 0 best solutions below