<commit_before># MongoDB Session Storage for ExpressJS

This module is an addon for ExpressJS that adds a new Session Storage device.


## Install

    npm install express-session-mongo

## Usage

The standard usage, is to just pass an instantiated `MongoStore` instance to the session plugin. 

    var xp = require('express'),
        MongoStore = require('express-session-mongo');

    var app = xp.createServer();

    app.configure(function(){
        app.use(xp.cookieDecoder());
        app.use(xp.session({ store: new MongoStore() }));
        app.use(app.router);
    });

You can also pass several options to the constructor to tweak your session store:

* db - The name of the db to use, defaults to: `express-sessions`
* ip - The IP address of the server to connect to, defaults to: `127.0.0.1`
* port - The Port to connect to, defaults to: `27017`
* collection - The collection to save it's data to, defaults to: `sessions`
* server - A custom mongo Server instance (this overides db, ip &amp; port):

<pre><code>var CustomServer = new Server(123.456.789.1, 12345, { auto_reconnect: true }, {});
app.use(xp.session({ store: new MongoStore({ server: CustomServer }) }));</code></pre>


## License

Licensed under my standard BSD license.

### Based on these classes

   [Sencha Connect Memory Store](https://github.com/senchalabs/connect/tree/master/lib/connect/middleware/session/memory.js)
   [ciaranj's express-session-mongodb](https://github.com/ciaranj/express-session-mongodb)<commit_msg>More README Tweaks<commit_after># MongoDB Session Storage for ExpressJS

This module is an addon for ExpressJS that adds a new Session Storage device.


## Install

    npm install express-session-mongo

## Usage

The standard usage, is to just pass an instantiated `MongoStore` instance to the session plugin. 

    var xp = require('express'),
        MongoStore = require('express-session-mongo');

    var app = xp.createServer();

    app.configure(function(){
        app.use(xp.cookieDecoder());
        app.use(xp.session({ store: new MongoStore() }));
        app.use(app.router);
    });

You can also pass several options to the constructor to tweak your session store:

* db - The name of the db to use, defaults to: `express-sessions`
* ip - The IP address of the server to connect to, defaults to: `127.0.0.1`
* port - The Port to connect to, defaults to: `27017`
* collection - The collection to save it's data to, defaults to: `sessions`
* server - A custom mongo Server instance (this overides db, ip &amp; port):

<pre><code>var CustomServer = new Server(123.456.789.1, 12345, { auto_reconnect: true }, {});
app.use(xp.session({ store: new MongoStore({ server: CustomServer }) }));</code></pre>


## License

Licensed under my standard BSD license.

### Based on these classes

* [Sencha Connect Memory Store](https://github.com/senchalabs/connect/tree/master/lib/connect/middleware/session/memory.js)
* [ciaranj's express-session-mongodb](https://github.com/ciaranj/express-session-mongodb)
{'fraction_non_alphanumeric': 0.12205638474295191, 'fraction_numerical': 0.01724709784411277, 'mean_word_length': 3.9040650406504067, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6375757', 'n_tokens_mistral': 954, 'n_tokens_neox': 885, 'n_words': 313}