I have this SignalR / MVC web application I'm building.
I currently have login and logout functionnality using ajax calls.
I would like to have those transit via SignalR instead. Is that possible? I'm having a hard time understanding how the auth cookie is going to be handled.
Currently my controller action login does this
[HttpPost]
public ActionResult Login()
{
var nickname = Request.Params["nickname"];
var password = Request.Params["password"];
// [Some database stuff...]
FormsAuthentication.SetAuthCookie(agencyMember.Id.ToString(), true);
}
So to give this a try, I've setup my logout function in my hub:
public class Proto1 : Hub
{
[Authorize(RequireOutgoing = false)]
public string Logout() {
FormsAuthentication.SignOut();
return "ok";
}
This does'nt work, when I debug, I get a "Response is not available in this context." exception and the logout does not go through.
Am I going wrong about this?
Thanks!