GithubHelp home page GithubHelp logo

adathedev / mongodb-asp.net-session-state-store Goto Github PK

View Code? Open in Web Editor NEW
31.0 5.0 10.0 1.28 MB

Custom ASP.NET session state store using MongoDB

Home Page: http://www.adathedev.co.uk/2011/05/mongodb-aspnet-session-state-store.html

C# 100.00%

mongodb-asp.net-session-state-store's Introduction

mongodb-asp.net-session-state-store's People

Contributors

adathedev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mongodb-asp.net-session-state-store's Issues

Does not support load balanced servers

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.

Remove calls to MongoServer.Disconnect

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.