Web API should be RESTful, but I need to authenticate the calls. Anyone can send REST calls from their browser to my server and I have to make sure that they are logged in (have a sesson cookie) and that they have access to the object they try to read and
write to.
I have followed the steps in this article:
https://www.strathweb.com/2012/11/adding-session-support-to-asp-net-web-api/
It works well for GET calls. But I still don't get any information about session or context in POST and PATCH calls. In fact I find that:
HttpContext.Current == NULL
How to solve?
( I can't believe this isn't a major issue for anyone dealing with REST calls and login-protected data.)
Vilhelm Heiberg Exorive AS Norway