I am using an ASP.NET cookie-based authentication identifier. I set ExpireTimeSpan in the CookieAuthenticationOptions class to control how long the inactivity time is allowed before the user logs back in.
This all works fine, but when I add SignalR to the application, the user no longer needs to log in after a period of inactivity. SignalR periodically makes a ping request, and I assume that this leads to an extension of the cookie.
I am looking for a way to not extend cookie expiration for SignalR URLs.
I reviewed some of the code in Microsoft.Owin.Security.Cookies and in particular the CookieAuthenticationHandler class. There is logic in the AuthenticateCoreAsync method to decide whether to update a cookie. However, the CookieAuthenticationHandler class is internal, so I cannot override this method.
Any ideas if there is a hook I can use for this?
source
share