Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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>
like image 727
chugh97 Avatar asked Nov 30 '25 14:11

chugh97


1 Answers

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.

like image 61
knightpfhor Avatar answered Dec 03 '25 03:12

knightpfhor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!