2

I want to track and list all active sessions for a individual who is logged into my site. Is it correct to say that I can use or extend ASP.NET's SessionProvider for this purpose?

My intent is to edit or enhance the existing Azure Table Session Provider for this purpose. What methods will be reliably (or not reliably) called to track who is active, and who isn't?

Should I ignore the session provider all together and implement my own logic?

makerofthings7
  • 60,103
  • 53
  • 215
  • 448
  • 1
    People around here must be sick of hearing me say this, but don't use the Azure Table Session Provider, it's a sample and not supported by MS for good reason, it has real issues in a production environment. http://stackoverflow.com/questions/3940891/asp-net-mvc-azure-error-accessing-the-data-store/3952346#3952346 – knightpfhor Jul 26 '12 at 21:03

1 Answers1

0

You should take a look at Azure Shared Cache (currently in preview) or Azure Cache for ASP.NET Session State. As for tracking sessions for who is currently online - you could use the DataCache for each page request (or Global.Session_Start) using some sliding expiration and DataCacheTag.

To query which user sessions are active - you could use GetObjectsByTag. For the tag itself - you could just use the user ID.

SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173
  • Won't I need a backing store if a node fails, the cache is overwhelmed with data, or some cache specific expiration occurs before the session itself expires? – makerofthings7 Jul 27 '12 at 01:11
  • 1
    As pointed out by Silver, it is recommended to store session data in cache. If you're worried that a single cache instance is insufficient, you can use multiple instances. Even if one instance crashes, your session data is still safe. – Ming Xu - MSFT Jul 30 '12 at 15:33