I set a property in the base controller so that I can have access to its value from every action. Originally I put code to get the value (from a cookie) in the OnActionExecuting
method, which works, but then I realized it's going to get called on every action call (some pages may run it hundreds of times because of repeating partial views). How could I do it so it's only called once per page?
I looked at a similar answered question... How to call a function *only once* in ASP.NET MVC page cycle but the answer only deals with Ajax requests, which is not my problem.