Permalink
Browse files

minors

  • Loading branch information...
1 parent 047ca68 commit ec608611617dde30d6cf867ff9d4b826ae274e23 @adamansky adamansky committed Jan 3, 2013
Showing with 8 additions and 14 deletions.
  1. +2 −1 .gitignore
  2. +4 −11 example/app.js
  3. +2 −2 lib/connect-session-ejdb.js
View
@@ -1,2 +1,3 @@
/.idea
-/ejdb-connect-session.iml
+/ejdb-connect-session.iml
+/example/mysessdb*
View
@@ -1,21 +1,15 @@
var connect = require("connect");
-var urlrouter = require("urlrouter");
var SessEJDB = require("../");
//Open EJDB
var jb = require("ejdb").open("mysessdb");
connect(
connect.cookieParser(),
- connect.session({ secret : "mysecret", store : new SessEJDB(jb) }),
- urlrouter(function(app) {
- app.get("/", function(req, res, next) {
- res.end("hello urlrouter");
- });
- app.get("/user/:id([0-9]+)", function(req, res, next) {
- res.end("hello user " + req.params.id);
- });
- })).listen(3000);
+ connect.session({ secret : "mysecret", store : new SessEJDB(jb), cookie : { maxAge : 60000 } }),
+ function(req, res) {
+ res.end("Hello!\n");
+ }).listen(3000);
var exitProgress = false;
@@ -38,7 +32,6 @@ function shutdown(nexit, ecode) {
}
}
-
process.on("exit", function() {
shutdown(true);
});
@@ -51,8 +51,8 @@ EJS.prototype.get = function(sid, cb) {
}
var d = obj ? obj.d : null;
if (d) {
- var expires = (d.cookie && (typeof d.cookie.expires === "string")) ?
- new Date(d.cookie.expires) : d.cookie.expires;
+ var expires = (d.cookie && (typeof d.cookie._expires === "string")) ?
+ new Date(d.cookie._expires) : d.cookie._expires;
if (!expires || new Date < expires) {
cb && cb(null, d);
} else {

0 comments on commit ec60861

Please sign in to comment.