Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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:
HttpContext.Current.Session["token"] = "XXXXX"
UmbracoContext.HttpContext.Session["token"] = "XXXXX"
ExceptionMessage: "Object reference not set to an instance of an object."
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
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted