New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Forms Authentication auth cookie will never timeout #2907
Comments
The purpose of the ping is to ensure auth cookies are reissued. If you want to disable pings, try starting your connection with the $.connection.hub.start({pingInterval: null}).done(function () { /* ... */ }); Unfortunately, chances are that if you are using a transport other than WebSockets, SignalR will issue requests periodically anyway. |
I tried setting the pingInterval to null and found that there are still requests being issued as you stated so that was not a solution. In the end I added an HttpModule to my application that looked at the request path and if signalr it clears any FormsAuthentication Cookie from the response ensuring that the auth cookie is not reissued and expires after user inactivity as before. |
@moity Can you please post your solution? I need this feature too. |
My implementation has evolved a little but this is basically it (remember to register the module in your config, or via code):
|
Hi, where should i add it? in Startup.cs? |
It's an HttpModule so you register it like any other, in your web.config or via code, startup.cs will work. |
Using SignalR with Forms Authentication (ASP.NET MVC4, SignalR 2.0.2.0) is it possible to have Pings and Reconnects not reissue the Auth cookie (set it's timeout further into the future)?
Basically, I want the Auth cookie to timeout (which it was doing until having SignalR in the solution).
I can see the Auth Cookie in the Response Headers being reissued on Ping and Reconnects.
I've read the documentation and searched extensively but found nothing around this - can it be done via configuration or a HubPipelineModule?
Any help appreciated.
The text was updated successfully, but these errors were encountered: