Couchbase sessions

We are using SDK 2.6/2.7 (.Net Framework -Asp.net MVC). The Asp.net Session is not retrieving. It is retrieved as null. Basically it is taking time for retrieval the values. If we make some time delay using Thread.sleep. The session is working fine. Can you please check and advise the below issue.

Version Details

We are using Enterprise Edition 6.0.1 build 2037 ‧ IPv4

We are using .Net 4.6.1 Framework(MVC)

We are using 2.6.0.0 SDK (Couchbase.NetClient)

We are using below DLL version in our applications

Couchbase.NetClient 2.6.0.0
Couchbase.AspNet 3.0.0.0
Common.Logging.Core 3.4.1.0
Common.Logging 3.4.1.0
Newtonsoft.Json 9.0.0.0
OpenTracing 0.12.0.0
OpenTracing.Signed 0.10.4.0

#Step 1: Assign session values

public ActionResult Index()

{

Session[“Hello”] = DateTime.Now.AddDays(-2);

Session[“Test”] = “test-Couchbase-SS”;

return RedirectToAction(“Details”, false);

}

#Step 2:

public ActionResult Details()

{

Thread.Sleep(95000);

var session = “Session Hello: [” + Convert.ToString(Session[“Hello”]) + “]” + " " + Session[“Test”].ToString(); //Retrive session value is taking more time when we use thread.sleep for testing purpose. It is

working fine

return Content(session);

}

Sample config Entry:

<add name=“Couchbase” timeout=“20” type=“Couchbase.AspNet.Session.CouchbaseSessionStateProvider,Couchbase.AspNet, Version=3.0.0.0, Culture=neutral, publicKeyToken=be12d0a2da0eb156”

bucket=“xyz” username=" " password=" " bootstrapStrategy=“inline”

servers=“https://abc/pools/default/buckets” useSsl=“false” prefix=“ss_portal” throwOnError=“false” />

Hi @mani,

If the Thread.Sleep isn’t there, then it works fine. But when there’s a Thread.Sleep, the value is no longer in session (and returns a null)? Is that correct?

It sounds like the Session is expiring (which is why the value would be null). But I see a timeout of 20 in your configuration. Is it possible that 20 minutes is passing between setting a session value and retrieving it?

yes, Session is returning null. I have increased the value till 72000. Still Session is returning null

<add name="Couchbase" timeout="72000"