Taobao has her own distributed session framework, the. NET camp can not lag behind, did a mongodb based on the support of up to 26 MongoDB distributed session framework.
First look at the configuration file:
<?xml version="1.0" encoding="utf-8" ?>
<MongoDBSession>
<DbName>SessionDB</DbName>
<IdentityMap
Identity="A">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="B">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="C">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="D">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="E">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="F">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="G">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="H">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="I">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="J">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="K">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="L">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="M">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="N">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="O">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="P">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="Q">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="R">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="S">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="T">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="U">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="V">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="W">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="X">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="Y">mongodb://localhost</IdentityMap>
<IdentityMap
Identity="Z">mongodb://localhost</IdentityMap>
</MongoDBSession>
From identity A to Z, the default is divided into 26 maps, the specific C # application code:
protected void btnTest_Click (object sender, EventArgs e)
{
session["A"] = DateTime.Now;
session["B"] = 1111111111111;
session["C"] = "fffffffffffffff";
}
protected void Btngetsession_click (object sender, EventArgs e)
{
Response.Write (session["A"]. ToString ());
Response.Write ("<br/>");
Response.Write (session["B"). ToString ());
Response.Write ("<br/>");
Response.Write (session["C"]. ToString ());
}
protected void Btnabandon_click (object sender, EventArgs e)
{
Session.Abandon ();
}