Framework: ASP.Net MVC 3
When a request comes in, I am intercepting the request through a global filter and performing a database look up based on the subdomain. The return int from the DB lookup needs to be persisted to other objects (i.e. Controllers) so that the DB hit doesn't need to be performed again whenever that data might be needed.
I was hoping to avoid using cookies since this information is a pertinent part of the system and I didn't want to rely on cookies being enabled.
I have read the related questions here and here which have not provided any good answers.
I actually have two questions:
As of now I had come up with a Subdomain manager object which does the heavy lifting and through my IoC have the manager object be HTTP Request scoped and I can grab that manager anytime during the request as a possible solution.
Is there a better way to carry this information across different object in the MVC request pipeline after I have looked it up? - I had examined the idea of putting the information back into the request somehow (which pertains to question #2).
If you were to use the Request to store the data (i.e. intercept the request, perform look up, write to the request) where would be the logical place to hold that information?
I reviewed the session but this seems to be closely tied to the way the web server is configured for sessions and I already mentioned I don't want to use cookies. Other areas such as post data and query string collections are locked down for their security reasons.
Any suggestions?