JedWatson/keystone — pull request #440 by coldfire22x (2014-06-24 23:21:23+00:00)
Title: adding session replica support

hey Jed,

this is just something for you to consider (I opened this pull request more for discussion than approval) ... I was having all sorts of problems with https://github.com/kcbanner/connect-mongo and replica sets and it turns out it doesn't support replica sets (at all). https://github.com/diversario/connect-mongostore does, but requires a specific configuration object so while it might not be the simplest or most desirable solution, I've done some testing and it at least appears to work.

it also gives you the flexibility to split out session handling to a different set of mongo servers or with a different database name, though I don't know why you would want to do that ...

example 'session store' configuration object:

```
"sessionStore": {
"collection": "app_sessions",
"db": {
"name": "myDb",
"servers": [
{ "host": "192.168.1.100", "port": 28001 },
{ "host": "192.168.1.100", "port": 28002 },
{ "host": "192.168.1.101", "port": 27017 }
]
}
}
```