0

I have Load balancer for balancing load between two nodes.

When a User logs out, am hitting the same login page back. If User was logged into node1 , after logout, I want to take User to node2.

Redirection rule put in Load balancer is not working (Rule is mentioned below). So , am thinking of removing JSESSIONDID when User logs out assuming that now it might go to a different node.

Before log out I need to invalidate session. If I follow below steps,

1. Remove JSESSIONID
2. session.invalidate();

In above case, if JSESSIONID is removed before invalidating session, will it invalidate the session? Because SESSIOND ID is already removed

1. session.invalidate();
2. Remove JSESSIONDID

In this case, I have already invalidated the session. So, will I be able to remove JSESSIONID?

Redirection rule:

if ( ($url == "loginPageURL") && ( http.getcookie( "JSESSIONID" ) == "" )) 
{
 http.setcookie( "JSESSIONID", "" );
}
Vikas V
  • 3,176
  • 2
  • 37
  • 60
  • 1
    just out of curiosity, I don't get the point in forcing the user to another node. That is what the load-balancer takes care , right ? – Riju Mahna Jan 15 '13 at 07:44

1 Answers1

0

That might work however I don't think that was LoadBalancer really for, Load Balancer should balancing load on servers and route user to one of the server in your server pool, so that if one server is down or fully busy User can still use the application on other servers without noticing that. Stick them on to one single server makes your web server has no fall back plan.

Instead of that you should try to use Load Balancer with some shared session technology so all your server can share session to each other

Simon Wang
  • 2,843
  • 1
  • 16
  • 32
  • Problem that am facing is, Users are not closing their browsers and again and again load is routed onto same server. Concurrency is increasing in 1 server alone. So, after logout I want user to hit another node. – Vikas V Jan 15 '13 at 07:50
  • In that case you might want checkout why load balancer doing so, and you need to find out what exactly load balancer decide route user this way, you may need clear other cookie as well to make load balancer think it is a new request – Simon Wang Jan 15 '13 at 07:57
  • "_you may need clear other cookie as well to make load balancer think it is a new request_" Am clearing all cookies.. But, I have mentioned my problem in my question above about JSESSIONID. Can you pls re look at that ...? – Vikas V Jan 15 '13 at 08:03