Proxying to node.js + express.js, session doesn't persist

ilya nginx-forum at nginx.us
Fri Jul 22 00:03:29 UTC 2011


> All of the requests you've provided have identical
> connect.sid as 
> far as I see.
> 

Yeah, maybe the session lasted that long. I kept clicking and I saw
cookie change every few seconds, though.


> This may be a problem if e.g. your backend is
> multi-process, while 
> session store is local to process.  With HTTP/1.1
> and keepalive 
> you'll be most likely talking to one process over
> established 
> connection (and everything seems to work ok),
> while though nginx 
> there will be new connection to your backend for
> each request and 
> you'll be talking to many backend processes (and
> you'll see 
> "flacky" sessions as described).  This is a
> typical example of 
> "something wrong with session storage on backend
> side" as 
> mentioned in previous message.

My backend is, in fact, multi-process - I use Cluster
(https://github.com/LearnBoost/cluster), which spawns 4 workers, one per
CPU core. I'm discussing this with Express/Cluster developer and he just
mentioned the same thing. If that's the case - how would I fix that,
then?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,212747,212779#msg-212779



More information about the nginx mailing list