redis-sessions
Advanced tools
Comparing version 0.1.5 to 0.1.6
{ | ||
"name": "redis-sessions", | ||
"description": "A universal session store for Redis", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"author": "P. Liess <smrchy+npm@gmail.com>", | ||
@@ -6,0 +6,0 @@ "engines": { |
@@ -147,1 +147,55 @@ # Redis Sessions | ||
### Kill | ||
Kill a single session by supplying app and token: | ||
```javascript | ||
rs.kill({ | ||
app: app, | ||
token: "r30kKwv3sA6ExrJ9OmLSm4Wo3nt9MQA1yG94wn6ByFbNrVWhcwAyOM7Zhfxqh8fe"}, | ||
function(err, resp) { | ||
/* | ||
resp contains the result: | ||
{kill: 1} | ||
*/ | ||
}); | ||
``` | ||
Note: If {kill: 0} is returned the session was not found. | ||
### Activity | ||
Query the amount of active session within the last 10 minutes (600 seconds). | ||
```javascript | ||
rs.activity({ | ||
app: app, | ||
dt: 600}, | ||
function(err, resp) { | ||
/* | ||
resp contains the activity: | ||
{activity: 12} | ||
*/ | ||
}); | ||
``` | ||
### Killall | ||
Kill all sessions of an app: | ||
```javascript | ||
rs.killall({app: app}, | ||
function(err, resp) { | ||
/* | ||
resp contains the result: | ||
{kill: 12} // The amount of sessions that were killed | ||
*/ | ||
}); | ||
``` |
54240
201