chugh97
chugh97

Reputation: 9984

How do I know if I have configured Azure Caching correctly for Session State

I can inspect the Session object which says its Custom but I cannot see the Cache size increasing on Azure (management portal). How can I definitely found out if my session info is being stored. If I miss spell the url for caching it gives me an error.Apart from that is there any way to definitely inspect something has been added to the cache?

 <sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider" compressionEnabled="false" timeout="50" >
          <providers>
              <add name="AppFabricCacheSessionStoreProvider"
                   type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider,Microsoft.Web.DistributedCache"
                   applicationName="xxxxx"
                   cacheName="default"
                   useBlobMode="true"
                   dataCacheClientName="default"/>
          </providers>
      </sessionState>

Upvotes: 3

Views: 233

Answers (1)

knightpfhor
knightpfhor

Reputation: 9399

There is no "cache browser" that I'm aware of (but would be happy to be proven wrong because that would be quite cool and interesting), so the only way I know of testing session state is to make sure you have at least 2 two instances of your role, have one page that sets a value in session and another that reads that value. Use the setting page once, then go to the reading page and mash the refresh button in your browser. If you see the correct value every time then the cache is working because at least one of the requesst has been sent to the instance that you didn't set the value on. Not pretty, but there you go.

Upvotes: 1

Related Questions