0

I would like to set a variable globally that has the AD Username and emails address and check status if the logged in user is a member of a certain group. I can do this via a controller - but I would like to be able to have a global variable that works for all views. Is this possible?

Thanks, EB

EbertB
  • 95
  • 3
  • 9
  • Why would user-specific information be globally available? –  Jul 03 '19 at 15:48
  • [Session](https://stackoverflow.com/questions/14138872/how-to-use-sessions-in-an-asp-net-mvc-4-application) – Andrei Jul 03 '19 at 15:56
  • When a user opens the intranet site I want to set some variables that are always available regardless of what view I am in. Will sessions do this? I do have a session setup in my main controller but I don't this this session is always available? – EbertB Jul 03 '19 at 16:07
  • @EBaze, depends what you mean by "always". It will be available until user closes the browser, or in whatever time session expires – Andrei Jul 03 '19 at 16:21
  • @Andrei - Perfect. Thanks!! – EbertB Jul 03 '19 at 16:38
  • @User.Identity.Name if you are using AD – ZCoder Jul 03 '19 at 16:46

0 Answers0