.NET client and ASP.NET SessionStateProvider - important migration notes
I recently switched over from the older Membase namspaced .NET client and the memcached-providers .NET SessionStateProvider to the Couchbase .NET client and couchbase-aspnet. I ran into a few hiccups that might be useful for others and should maybe be mentioned in documentation somewhere.
First of all, Couchbase.Configuration.CouchbaseClientSection requires you leave the bucket name off of the URI.
What would formerly be:
<servers bucket="SessionState"> <add uri="http://localhost:8091/pools/SessionState" /> </servers>
<servers bucket="SessionState"> <add uri="http://localhost:8091/pools" /> </servers>
The next thing is that there's an undocumented "section" config attribute for the custom SessionStateProvider.
<sessionState customProvider="Couchbase" mode="Custom" timeout="500"> <providers> <add name="Couchbase" type="Couchbase.AspNet.SessionState.CouchbaseSessionStateProvider, Couchbase.AspNet" section="couchbaseSessionState" /> </providers> </sessionState>
The above config allows you to specify the config section that will apply to the SessionState. This likely doesn't matter if you just have the default "couchbase" config section, but if you're using multiple config sections for multiple buckets then this is invaluable.