sandeep.mishra
sandeep.mishra

Reputation: 825

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

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

Upvotes: 0

Views: 524

Answers (0)

Related Questions