sticky using session variables

Answered Question
Feb 5th, 2007

Hello

I was wondering if it is possible to stick a session to a server using session variables (such as username) Currently I am using cookies to keep the session sticky but i also need to use the session variables.

Thanks

Donagh

I have this problem too.
0 votes
Correct Answer by Gilles Dufour about 9 years 7 months ago

Donagh,

the session variable are dependent on your application.

The loadbalancer only knows HTTP.

So, how does your session variable translates into HTTP data ?

Is it info inside the url ?

Is it a value in the HTTP header ?

If this is inside the HTTP body, the loadbalancer will not see it.

If you are already using a cookie to do stickyness, I think it should be enough.

Gilles.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.5 (2 ratings)
Loading.
Correct Answer
Gilles Dufour Tue, 02/06/2007 - 04:41

Donagh,

the session variable are dependent on your application.

The loadbalancer only knows HTTP.

So, how does your session variable translates into HTTP data ?

Is it info inside the url ?

Is it a value in the HTTP header ?

If this is inside the HTTP body, the loadbalancer will not see it.

If you are already using a cookie to do stickyness, I think it should be enough.

Gilles.

donaghq_2 Tue, 02/06/2007 - 04:48

Hi Gilles

Thanks for the reply.

The session variable is in the url. Could I do balancing with "cookiesurl" and define the variables aswell as the cookies?

I agree that cookies should be enough but application wants to do stickiness on both.

Cheers

Donagh

Gilles Dufour Tue, 02/06/2007 - 05:09

Donagh,

there is absolutely no reason to use both.

If the name is more important, than use the name.

If the cookie is more important, than use the cookie.

If one is not more important than the other, then keep using the cookie.

Another way to see it is :

if the name and the cookie refer to the same server, it does not matter which one you use.

But if they point to different servers.

What do you do ?

Which information do you use to select the server ?

The name or the cookie ?

As I said, there is no reason to use both.

Unless if one is missing.

But the problem is then to make sure it is always there.

Is there any stickyness issue currently ?

Gilles.

donaghq_2 Fri, 02/09/2007 - 10:02

hi Gilles, the application people have used the session variable to stick to a particular webserver.

Thanks for your help

Donagh

Actions

This Discussion