Welcome! Log In Create A New Profile

Advanced

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

Maxim Dounin
July 21, 2011 04:54PM
Hello!

On Thu, Jul 21, 2011 at 12:28:39PM -0400, ilya wrote:

> > Are you see sessions not being flacky while working directly with
> > your backend?
>
> Correct. I've tested backend standalone and this doesn't happen. Notice,

So try to figure out what goes wrong. Dumping all of a session
requests till session break may be helpful, as well as dumping all
of the requests between nginx and your backend.

Instrumenting your backend's code may be helpful as well (or even
easier).

> that in requests above connect.sid is changing every request. That is
> not supposed to happen - with standalone backend connect.sid value is
> constant across requests and changes either when user re-logins or it
> expires.

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

> Can it be because nginx talks HTTP/1.0 to backend?.. Ugh.

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.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

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

ilya July 21, 2011 06:45AM

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

Maxim Dounin July 21, 2011 07:54AM

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

ilya July 21, 2011 11:18AM

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

Maxim Dounin July 21, 2011 11:36AM

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

ilya July 21, 2011 11:45AM

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

Maxim Dounin July 21, 2011 12:14PM

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

ilya July 21, 2011 12:28PM

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

Maxim Dounin July 21, 2011 04:54PM

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

ilya July 21, 2011 08:03PM

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

jzabel May 10, 2012 12:45PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 134
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready