I have ASP.NET webforms app. This app uses cookie-based authentication. Also I have ASP.NET Web API that receives AJAX requests from webforms app. What i'd like to do is have possibility in controller's actions know if request comes from authenticated user and get user id.
I don't have much experience in web development.
Could you advice some good approach to accomplish this goal?
I think most suitable way is to use OWIN cookieAuthentication middleware. It is described here Is possible to use cookie based authentication with ASP.NET Web API and SPA?