From 9fa8612936ab78eee810761f66038ca7811c993e Mon Sep 17 00:00:00 2001 From: Ritchie Martori Date: Thu, 13 Dec 2012 20:31:12 -0800 Subject: [PATCH] added annonymous session cleanup at startup --- HISTORY.md | 30 ++++++++++++++++-------------- lib/session.js | 3 +++ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index be38247..0ca7030 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,23 +3,25 @@ ## 0.7.0 ### New Features -- New utilities for extending Resource Types. - - Added `Resource.extend("ResourceName", { /* members */ })` syntax for extending Resources. The `init()` function is used as a constructor. The old `util.inherits()` syntax will continue to work. - - Moved `Resource` base class to the exports of the deployd module. You can now use `require('deployd').Resource` instead of `require('deployd/lib/resource')`. - - Added `get(ctx, next)`, `post(ctx, next)`, `put(ctx, next)`, and `del(ctx, next)` utility functions on `Resource`. You can now override those instead of `handle()`. -- New `Module` type in extension API - - Modules can define multiple Resource Types with `this.addResourceType()` - - [TODO] Modules can register their own dashboards. -- Added `dir` to server options - for booting in other directories than `process.cwd()`. -- Resources now support custom events by default -- New collection permission api + + - New utilities for extending Resource Types. + - Added `Resource.extend("ResourceName", { /* members */ })` syntax for extending Resources. The `init()` function is used as a constructor. The old `util.inherits()` syntax will continue to work. + - Moved `Resource` base class to the exports of the deployd module. You can now use `require('deployd').Resource` instead of `require('deployd/lib/resource')`. + - Added `get(ctx, next)`, `post(ctx, next)`, `put(ctx, next)`, and `del(ctx, next)` utility functions on `Resource`. You can now override those instead of `handle()`. + - New `Module` type in extension API + - Modules can define multiple Resource Types with `this.addResourceType()` + - [TODO] Modules can register their own dashboards. + - Added `dir` to server options - for booting in other directories than `process.cwd()`. + - Added `errorTemplate` to server options - for overriding the default error template. + - Resources now support custom events by default + - New collection permission api ### Breaking Changes -- Most configuration properties on the `Resource` class have been moved to the prototype: `external`, `events`, `basicDashboard`, and `dashboard`. - - The `label` and `defaultType` properties will remain on the constructor, as they shouldn't be inherited. -- The configuration option `Resource.events` has been renamed `Resource.eventNames`. - + - Most configuration properties on the `Resource` class have been moved to the prototype: `external`, `events`, `basicDashboard`, and `dashboard`. + - The `label` and `defaultType` properties will remain on the constructor, as they shouldn't be inherited. + - The configuration option `Resource.events` has been renamed `Resource.eventNames`. + - Anonymous sessions are now destroyed every time the server starts. ### Major Bugfixes diff --git a/lib/session.js b/lib/session.js index 36292fc..6ac4e39 100644 --- a/lib/session.js +++ b/lib/session.js @@ -41,6 +41,9 @@ function SessionStore(namespace, db, sockets) { } Store.apply(this, arguments); + + // clear annonymous sessions + this.remove({uid: {$exists: false}}); } util.inherits(SessionStore, Store); exports.SessionStore = SessionStore;