Skip to content

deleted sessionID but browser still has it, and it blows-up #463

Closed
cordoba opened this Issue Jan 23, 2012 · 4 comments

4 participants

@cordoba
cordoba commented Jan 23, 2012

When sessions are stored (with riak in my case), and then deleted from store but browser still has it and then a request is made, server code blows up as following error message shows:

Express
500 Error: undefined
at IncomingMessage. (....../node_modules/riak-js/lib/http_client.js:384:76)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.onMessageComplete (http.js:137:23)
at Socket.ondata (http.js:1124:24)
at TCP.onread (net.js:348:27)

I temporarily solved it with following provided git diff. However briefly in returned session function store.get call results with some err (correctly reported by persistence store) the code checks if ('ENOENT' == err.code) { (and for this case it is false) and flow results with next(err). If false branch is same as true branch it works.

index 7224896..f511421 100644
--- a/express/node_modules/connect/lib/middleware/session.js
+++ b/express/node_modules/connect/lib/middleware/session.js
@@ -264,7 +264,8 @@ function session(options){
generate();
next();
} else {

  • next(err);
  • generate();
  • next(); } // no session } else if (!sess) {
@tj
Sencha Labs member
tj commented Jan 23, 2012

i'll mark this as a bug for now and add a test case when i have a min

@jonathanong

you got a test case for this? i'm going to guess it's an issue with risk's sessions not connect. or since it's been 2 years, is it still an issue?

@dougwilson

I think we can close this issue until someone chimes in. I looked a while back, but didn't see anything wrong.

@jonathanong

Yeah it's old and not specifically connect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.