I would like to use something like HttpContext.Application variable but in Owin self host?? i want to know if there is something equivalent for it in OWIN.
-
2Can you expand on what you are trying to do? What do you want to do with the Application object?– MichaelDotKnoxApr 2, 2018 at 16:10
-
I want to keep a list for all Logged in users. because i want to make the user login from only one device at a time so i have to keep like global or application scope list of all logged in users.– Amira MahmoudApr 26, 2018 at 11:34
-
I solved the problem by using a static class with a dictionary and add/remove/find methods but @MichaelDotKnox can you please tell me if you have a better way to handle this. Thank you– Amira MahmoudApr 26, 2018 at 11:38
-
You probably don't need to use a static class to do that, you would just need to pass it around to whatever middleware or controllers you use. You also need to think about concurrency issues in case someone tries to login from several devices at the same time. Post your code and we can take a look.– MichaelDotKnoxApr 26, 2018 at 19:31
Add a comment
|