/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['middleware/session/session.js']) {
  _$jscoverage['middleware/session/session.js'] = [];
  _$jscoverage['middleware/session/session.js'][13] = 0;
  _$jscoverage['middleware/session/session.js'][23] = 0;
  _$jscoverage['middleware/session/session.js'][24] = 0;
  _$jscoverage['middleware/session/session.js'][25] = 0;
  _$jscoverage['middleware/session/session.js'][26] = 0;
  _$jscoverage['middleware/session/session.js'][38] = 0;
  _$jscoverage['middleware/session/session.js'][39] = 0;
  _$jscoverage['middleware/session/session.js'][49] = 0;
  _$jscoverage['middleware/session/session.js'][50] = 0;
  _$jscoverage['middleware/session/session.js'][51] = 0;
  _$jscoverage['middleware/session/session.js'][62] = 0;
  _$jscoverage['middleware/session/session.js'][63] = 0;
  _$jscoverage['middleware/session/session.js'][64] = 0;
  _$jscoverage['middleware/session/session.js'][79] = 0;
  _$jscoverage['middleware/session/session.js'][80] = 0;
  _$jscoverage['middleware/session/session.js'][82] = 0;
  _$jscoverage['middleware/session/session.js'][83] = 0;
  _$jscoverage['middleware/session/session.js'][84] = 0;
  _$jscoverage['middleware/session/session.js'][85] = 0;
  _$jscoverage['middleware/session/session.js'][86] = 0;
  _$jscoverage['middleware/session/session.js'][88] = 0;
  _$jscoverage['middleware/session/session.js'][99] = 0;
  _$jscoverage['middleware/session/session.js'][100] = 0;
  _$jscoverage['middleware/session/session.js'][101] = 0;
  _$jscoverage['middleware/session/session.js'][102] = 0;
  _$jscoverage['middleware/session/session.js'][113] = 0;
  _$jscoverage['middleware/session/session.js'][114] = 0;
  _$jscoverage['middleware/session/session.js'][115] = 0;
}
_$jscoverage['middleware/session/session.js'][13]++;
var utils = require("../../utils");
_$jscoverage['middleware/session/session.js'][23]++;
var Session = module.exports = (function Session(req, data) {
  _$jscoverage['middleware/session/session.js'][24]++;
  Object.defineProperty(this, "req", {value: req});
  _$jscoverage['middleware/session/session.js'][25]++;
  Object.defineProperty(this, "id", {value: req.sessionID});
  _$jscoverage['middleware/session/session.js'][26]++;
  if ("object" == typeof data) {
    _$jscoverage['middleware/session/session.js'][26]++;
    utils.merge(this, data);
  }
});
_$jscoverage['middleware/session/session.js'][38]++;
Session.prototype.touch = (function () {
  _$jscoverage['middleware/session/session.js'][39]++;
  return this.resetMaxAge();
});
_$jscoverage['middleware/session/session.js'][49]++;
Session.prototype.resetMaxAge = (function () {
  _$jscoverage['middleware/session/session.js'][50]++;
  this.cookie.maxAge = this.cookie.originalMaxAge;
  _$jscoverage['middleware/session/session.js'][51]++;
  return this;
});
_$jscoverage['middleware/session/session.js'][62]++;
Session.prototype.save = (function (fn) {
  _$jscoverage['middleware/session/session.js'][63]++;
  this.req.sessionStore.set(this.id, this, fn || (function () {
}));
  _$jscoverage['middleware/session/session.js'][64]++;
  return this;
});
_$jscoverage['middleware/session/session.js'][79]++;
Session.prototype.reload = (function (fn) {
  _$jscoverage['middleware/session/session.js'][80]++;
  var req = this.req, store = this.req.sessionStore;
  _$jscoverage['middleware/session/session.js'][82]++;
  store.get(this.id, (function (err, sess) {
  _$jscoverage['middleware/session/session.js'][83]++;
  if (err) {
    _$jscoverage['middleware/session/session.js'][83]++;
    return fn(err);
  }
  _$jscoverage['middleware/session/session.js'][84]++;
  if (! sess) {
    _$jscoverage['middleware/session/session.js'][84]++;
    return fn(new Error("failed to load session"));
  }
  _$jscoverage['middleware/session/session.js'][85]++;
  store.createSession(req, sess);
  _$jscoverage['middleware/session/session.js'][86]++;
  fn();
}));
  _$jscoverage['middleware/session/session.js'][88]++;
  return this;
});
_$jscoverage['middleware/session/session.js'][99]++;
Session.prototype.destroy = (function (fn) {
  _$jscoverage['middleware/session/session.js'][100]++;
  delete this.req.session;
  _$jscoverage['middleware/session/session.js'][101]++;
  this.req.sessionStore.destroy(this.id, fn);
  _$jscoverage['middleware/session/session.js'][102]++;
  return this;
});
_$jscoverage['middleware/session/session.js'][113]++;
Session.prototype.regenerate = (function (fn) {
  _$jscoverage['middleware/session/session.js'][114]++;
  this.req.sessionStore.regenerate(this.req, fn);
  _$jscoverage['middleware/session/session.js'][115]++;
  return this;
});
_$jscoverage['middleware/session/session.js'].source = ["","/*!"," * Connect - session - Session"," * Copyright(c) 2010 Sencha Inc."," * Copyright(c) 2011 TJ Holowaychuk"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var utils = require('../../utils');","","/**"," * Create a new `Session` with the given request and `data`."," *"," * @param {IncomingRequest} req"," * @param {Object} data"," * @api private"," */","","var Session = module.exports = function Session(req, data) {","  Object.defineProperty(this, 'req', { value: req });","  Object.defineProperty(this, 'id', { value: req.sessionID });","  if ('object' == typeof data) utils.merge(this, data);","};","","/**"," * Update reset `.cookie.maxAge` to prevent"," * the cookie from expiring when the"," * session is still active."," *"," * @return {Session} for chaining"," * @api public"," */","","Session.prototype.touch = function(){","  return this.resetMaxAge();","};","","/**"," * Reset `.maxAge` to `.originalMaxAge`."," *"," * @return {Session} for chaining"," * @api public"," */","","Session.prototype.resetMaxAge = function(){","  this.cookie.maxAge = this.cookie.originalMaxAge;","  return this;","};","","/**"," * Save the session data with optional callback `fn(err)`."," *"," * @param {Function} fn"," * @return {Session} for chaining"," * @api public"," */","","Session.prototype.save = function(fn){","  this.req.sessionStore.set(this.id, this, fn || function(){});","  return this;","};","","/**"," * Re-loads the session data _without_ altering"," * the maxAge properties. Invokes the callback `fn(err)`,"," * after which time if no exception has occurred the"," * `req.session` property will be a new `Session` object,"," * although representing the same session."," *"," * @param {Function} fn"," * @return {Session} for chaining"," * @api public"," */","","Session.prototype.reload = function(fn){","  var req = this.req","    , store = this.req.sessionStore;","  store.get(this.id, function(err, sess){","    if (err) return fn(err);","    if (!sess) return fn(new Error('failed to load session'));","    store.createSession(req, sess);","    fn();","  });","  return this;","};","","/**"," * Destroy `this` session."," *"," * @param {Function} fn"," * @return {Session} for chaining"," * @api public"," */","","Session.prototype.destroy = function(fn){","  delete this.req.session;","  this.req.sessionStore.destroy(this.id, fn);","  return this;","};","","/**"," * Regenerate this request's session."," *"," * @param {Function} fn"," * @return {Session} for chaining"," * @api public"," */","","Session.prototype.regenerate = function(fn){","  this.req.sessionStore.regenerate(this.req, fn);","  return this;","};"];
