I'm new to Composite C1 and have the following scenario:
I'm deploying a MVC application as a set of functions to Composite. The thing is that I need to access the session from my MVC functions, but it is null.
I have tested some ideas, but none seems to work for me.
- Session is NULL when running ASP.NET MVC inside of ASP.NET
- MVC 5 Session is Null
- Session is null when redirect from one controller to another ASP.NET MVC
- MVC ASP.net session is null
- ASP.NET MVC - Session is null
Startup Handler is initialized like this:
public static void OnBeforeInitialize()
{
var functions = MvcFunctionRegistry.NewFunctionCollection();
functions.RegisterController<HomeController>("Company.Home");
functions.RegisterAction<HomeController>("Index", "Company.HomeIndex");
functions.RouteCollection.MapMvcAttributeRoutes();
functions.RouteCollection.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
}
Then, from any controller a call to session:
protected override void OnActionExecuting(ActionExecutingContext context)
{
var session = this.Session; // returns null
var request = this.Request; // this one is ok
var response = this.Response; // this one is ok too
// ...
}
returns null.
Any help is really appreciated.