1

I have a server on the WebApi2, and I need get all active users on the server. How to implement it? I think, maybe, save customerId after logIn in the session storage. But I don't know how to implement it.

Or maybe exists some best solutions for it. Help me please, with this issue.

Taras Kovalenko
  • 2,141
  • 2
  • 19
  • 48

2 Answers2

1

Use this article Adding Session support to ASP.NET Web API for example

as the entering point to find out the best solution.

garik
  • 5,485
  • 4
  • 28
  • 39
1

You can access session object using this kind of code.

Keep in mind that Web API provides REST services, and is from a design perpective not meant to access Session objects, as its purpose is to provide stateless methods.

This of course does not mean it is not technically feasible, as you can see on this SO answer.

Community
  • 1
  • 1
Benjamin Soulier
  • 1,975
  • 1
  • 16
  • 27