connect-hazelcast is a Hazelcast session store backed by Hazelcast 4.x.
npm install connect-hazelcast express-session
Pass the express-session
to connect-hazelcast
to create a HazelcastStore
constructor.
const session = require('express-session');
const HazelcastStore = require('connect-hazelcast')(session);
app.use(session({
store: new HazelcastStore(options),
secret: 'ssshhh'
}));
The following list contains all supported options:
client
An existing hazelcast client. Required option.prefix
IMap name to use for storing sessions. Defaults tosessions
.ttl
Default TTL in seconds to use when the session cookie does not have aexpires
value. Defaults to86400
(one day).disableTouch
When set totrue
, TTL is reset on each user interaction with the server. Defaults tofalse
.