Clear all Session variables at logout


#1

Is there any simple way to clean up all the values in the Session dictionary?


#2

I think the latest Meteor release has a clear() method on the ReactiveDict prototype (looking at source). If you are on 1.1 or something you should be able to just patch ReactiveDict like this

ReactiveDict.prototype.clear = function () {
    for (key in this.keys) {
        this.set(key, undefined);
    }
};

=> Session.clear();