redis-sessions
Advanced tools
Comparing version 0.1.17 to 0.1.18
@@ -33,3 +33,3 @@ // Generated by CoffeeScript 1.6.2 | ||
} | ||
this.redisns = redisns != null ? redisns : "rs:"; | ||
this.redisns = redisns != null ? redisns : "rs"; | ||
this.wipe = __bind(this.wipe, this); | ||
@@ -45,2 +45,3 @@ this.soid = __bind(this.soid, this); | ||
this.activity = __bind(this.activity, this); | ||
this.redisns = this.redisns + ":"; | ||
this.redis = RedisInst.createClient(redisport, redishost); | ||
@@ -47,0 +48,0 @@ setInterval(this.wipe, 60 * 1000); |
{ | ||
"name": "redis-sessions", | ||
"description": "An advanced session store for Redis", | ||
"version": "0.1.17", | ||
"version": "0.1.18", | ||
"author": "P. Liess <smrchy+npm@gmail.com>", | ||
@@ -6,0 +6,0 @@ "engines": { |
@@ -1,2 +0,2 @@ | ||
# Redis Sessions | ||
# Redis Sessions | ||
@@ -46,3 +46,3 @@ [![Build Status](https://secure.travis-ci.org/smrchy/redis-sessions.png?branch=master)](http://travis-ci.org/smrchy/redis-sessions) | ||
### Setup and creating the first session | ||
### Initialize redis-sessions | ||
@@ -53,9 +53,18 @@ ```javascript | ||
app = "myapp"; | ||
rsapp = "myapp"; | ||
``` | ||
### Create a session | ||
The `ttl` parameter is optional and defaults to 7200. | ||
```javascript | ||
// Set a session for `user1001` | ||
rs.create({ | ||
app: app, | ||
id: "user1001"}, | ||
app: rsapp, | ||
id: "user1001", | ||
ip: "192.168.22.58", | ||
ttl: 3600}, | ||
function(err, resp) { | ||
@@ -71,3 +80,3 @@ // resp should be something like | ||
rs.set({ | ||
app: app, | ||
app: rsapp, | ||
token: "r30kKwv3sA6ExrJ9OmLSm4Wo3nt9MQA1yG94wn6ByFbNrVWhcwAyOM7Zhfxqh8fe", | ||
@@ -105,3 +114,3 @@ d: { | ||
rs.get({ | ||
app: app, | ||
app: rsapp, | ||
token: "r30kKwv3sA6ExrJ9OmLSm4Wo3nt9MQA1yG94wn6ByFbNrVWhcwAyOM7Zhfxqh8fe"}, | ||
@@ -140,3 +149,3 @@ function(err, resp) { | ||
rs.set({ | ||
app: app, | ||
app: rsapp, | ||
token: "r30kKwv3sA6ExrJ9OmLSm4Wo3nt9MQA1yG94wn6ByFbNrVWhcwAyOM7Zhfxqh8fe", | ||
@@ -174,3 +183,3 @@ d: { | ||
rs.kill({ | ||
app: app, | ||
app: rsapp, | ||
token: "r30kKwv3sA6ExrJ9OmLSm4Wo3nt9MQA1yG94wn6ByFbNrVWhcwAyOM7Zhfxqh8fe"}, | ||
@@ -196,3 +205,3 @@ function(err, resp) { | ||
rs.activity({ | ||
app: app, | ||
app: rsapp, | ||
dt: 600}, | ||
@@ -214,3 +223,3 @@ function(err, resp) { | ||
rs.soid({ | ||
app: app, | ||
app: rsapp, | ||
id: "bulkuser_999"}, | ||
@@ -246,3 +255,3 @@ function(err, resp) { | ||
rs.killsoid({app: app, id: 'bulkuser_999'}, | ||
rs.killsoid({app: rsapp, id: 'bulkuser_999'}, | ||
function(err, resp) { | ||
@@ -263,3 +272,3 @@ /* | ||
rs.killall({app: app}, | ||
rs.killall({app: rsapp}, | ||
function(err, resp) { | ||
@@ -266,0 +275,0 @@ /* |
Sorry, the diff of this file is not supported yet
75309
1158
282