Session item returning null even after setting it

May 30, 2012 at 9:53 PM

Hi,

I wanted to use MemCached for storing my sessions. Following is my Config

<configSections>
      <section name="cacheProvider" type="MemcachedProviders.Cache.CacheProviderSection, MemcachedProviders"
       allowDefinition="MachineToApplication" restartOnExternalChanges="true" />
      <sectionGroup name="enyim.com">
          <section name="memcached" type="Enyim.Caching.Configuration.MemcachedClientSection, Enyim.Caching"/>
      </sectionGroup>
  </configSections>
 <enyim.com>
        <memcached protocol="Binary">
            <servers>
                <add address="127.0.0.1" port="11211" />
            </servers>
        </memcached>
    </enyim.com>
    <cacheProvider defaultProvider="MemcachedCacheProvider">
        <providers>
            <add name="MemcachedCacheProvider" type="MemcachedProviders.Cache.MemcachedCacheProvider, MemcachedProviders"  defaultExpireTime="2000"/>
        </providers>
    </cacheProvider>

I tried adding to Session like 
Session["test"] = some text;

But when I am getting the value, I am getting null. Where am I going wrong. Any help is appreciated.