|
/
Zope
/
Apsis
/
Pound Mailing List
/
Archive
/
2009
/
2009-10
/
how does session cookie work...
[
Help Needed / Ahamed Mukthaar ... ]
[
URL rewriting and Pound Proxy / John Jason ... ]
how does session cookie work...
Patrick Ma <cgeyma(at)hotmail.com> |
2009-10-27 20:00:12 |
[ FULL ]
|
Hi,
I have defined 1 service with 3 backends.
Session is tracked by cookie.
At login time of the backend, each backend sets a cookie with a value of its IP
address.
My question is WHEN does Pound set its mapping of cookie value and backend
server.
Is this correct?
client login request (no cookie yet) --> pound (round robin because of no
cookie) --> backend
backend (set cookie) --> pound (see cookie and map cookie value to
backend) --> client
What if I just restarted pound and the cookie value and backend mapping is
gone.
client request (with cookie) --> pound (see cookie but no mapping. so
round robin. now does pound map the cookie value to the backend it is going
to?) If so, the cookie value is not necessary the backend's IP address.
I am asking this because I am see the cookie value in the HTTP header but pound
is not sending the request to the backend I am expecting based on the IP
address.
Thanks.
Patrick Ma
[...]
|
|
|
|
|
RE: [Pound Mailing List] how does session cookie work...
"Alfonso Espitia" <aespitia(at)castleworldwide.com> |
2009-10-27 21:09:22 |
[ FULL ]
|
If this is developed in .net, you can use the aspnetsessionid like in
the following thread:
http://www.apsis.ch/pound/pound_list/archive/2007/2007-07/1184948236000/
index_html?fullMode=1#1185006949000
I'd assume other languages have a similar feature.
I think poundctl will show you the mapping of sessions to backends.
--Alfonso
-----Original Message-----
From: Patrick Ma [mailto:cgeyma(at)hotmail.com]
Sent: Tuesday, October 27, 2009 3:00 PM
To: Pound Mailing List
Subject: [Pound Mailing List] how does session cookie work...
Hi,
I have defined 1 service with 3 backends.
Session is tracked by cookie.
At login time of the backend, each backend sets a cookie with a value of
its IP address.
My question is WHEN does Pound set its mapping of cookie value and
backend server.
Is this correct?
client login request (no cookie yet) --> pound (round robin because
of no cookie) --> backend
backend (set cookie) --> pound (see cookie and map cookie value to
backend) --> client
What if I just restarted pound and the cookie value and backend mapping
is gone.
client request (with cookie) --> pound (see cookie but no mapping. so
round robin. now does pound map the cookie value to the backend it is
going to?) If so, the cookie value is not necessary the backend's IP
address.
I am asking this because I am see the cookie value in the HTTP header
but pound is not sending the request to the backend I am expecting based
on the IP address.
Thanks.
Patrick Ma
[...]
|
|
|
RE: [Pound Mailing List] how does session cookie work...
Patrick Ma <cgeyma(at)hotmail.com> |
2009-10-28 17:47:10 |
[ FULL ]
|
Thanks for the poundctl pointer.
The application is classic ASP.
I tried using the ASP session cookie before and it did not work because the
value of the cookie keeps changing and this is why I injected my own cookie
with the IP address as the value.
It works fine in the sense that it achieves session affinity but I am not
seeing close to evenly distributed balancing.
[...]
[...]
|
|
|
|
|
RE: [Pound Mailing List] how does session cookie work...
Patrick Ma <cgeyma(at)hotmail.com> |
2009-10-28 18:44:04 |
[ FULL ]
|
Hi Robert,
After using poundctl to see the internal of pound, I think I get the answer to
my original question.
Here is my experiment.
This setup has 2 backends.
I first get to the signon page of the application.
I have 2 browser windows open and made sure that each one is connected to a
different backend.
Now, I restarted pound while the 2 browser windows are still open.
When I refresh the page in the browser windows, the requests going to pound
already carry the session values.
poundctl at this point shows both sessions are pointing to backend #1.
This indicates when pound receives a request with the session value BUT pound
does not already have a mapping of the value to a backend, pound right away
maps the session value to a backend.
This is just an observation.
I am not sure if this is the right or wrong implementation.
Does it make sense to map the session value to a backend on its way back from
the backend to pound?
Thanks.
0. http Listener 53.67.28.38:81 a
0. Service active (10)
0. Backend 53.67.26.243:80 active (5 0.000 sec) alive
1. Backend 53.67.9.81:80 active (5 0.000 sec) alive
0. Session 53%2E67%2E9%2E81 -> 1
1. Session 53%2E67%2E26%2E243 -> 1
[...]
[...]
|
|
|
|
|
|