I have created an API for login authentication purpose.
The class extends UmbracoApiController, and it will calling another system endpoint to perform authentication and return user info.
Everything is going right, however, there are always have an error after I use the bellows code to set/get the session cookies:
Session Cookie always null
I have created an API for login authentication purpose. The class extends UmbracoApiController, and it will calling another system endpoint to perform authentication and return user info. Everything is going right, however, there are always have an error after I use the bellows code to set/get the session cookies:
or
or
ExceptionMessage: "Object reference not set to an instance of an object." ExceptionType: "System.NullReferenceException"
Hi Stephen
If I'm correct API controllers don't support session state out of the box.
Here is some more information on how to enable it : https://stackoverflow.com/questions/9594229/accessing-session-using-asp-net-web-api
Dave
is working on a reply...