adathedev / mongodb-asp.net-session-state-store Goto Github PK
View Code? Open in Web Editor NEWCustom ASP.NET session state store using MongoDB
Home Page: http://www.adathedev.co.uk/2011/05/mongodb-aspnet-session-state-store.html
Custom ASP.NET session state store using MongoDB
Home Page: http://www.adathedev.co.uk/2011/05/mongodb-aspnet-session-state-store.html
Please note this has not been extensively tested so I recommend you give it a thorough trial before using in a production environment. See my blog post on this project here: (Current, v1.1.0) http://www.adathedev.co.uk/2013/03/mongodb-aspnet-session-store-provider.html (Original, v1.0.0) http://www.adathedev.co.uk/2011/05/mongodb-aspnet-session-state-store.html Notes on use / configuration can be found in the above post, and also in the comments within MongoSessionStateStore.cs.
If this code is added to a load balanced server, you are unable to perform session based actions such as logging in. An initial entry into the sessions document, and the "expires" value appears to update on page refreshes, but it simply will not allow user actions such as logging in.
If the code is tested on individual servers (bi-passing the load balancer), it works perfectly.
Via a comment on original blog post:
"We've found through load testing this code has the following problem: it calls the "disconnect" method on the server object in several places. This may cause the Mongo driver to run out of connections and fail to connect to the server.
It turns out that the disconnect should not usually be invoked; it's better to let the driver handle the connection pooling internally.
See for example this blog post: http://craiggwilson.wordpress.com/2012/09/23/disconnecting-with-the-mongodb-driver/"
Bottom line, is that there is no need to call Disconnect() on a MongoServer instance. The API docs for the C# (http://api.mongodb.org/csharp/1.6/html/71b2d2c6-4c2d-ec27-b465-071dee0dd2f6.htm) state: "Disconnects from the server. Normally there is no need to call this method so you should be sure to have a good reason to call it." - I have no good reason to call it, so will remove those calls.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.