sessões PHP sem um período de expiração. O que acontece com a sessão persistente no balanceador de carga?

1

Estou usando sessões PHP sem um período de expiração, usando o Amazon EC2 Elastic Load Balancing com Sticky Sessions .. O que acontece com a sessão de aplicativos gerados no load balancer? Quando a aderência expirará?

    
por Marcel Al Mutawa 25.11.2015 / 14:12

1 resposta

0

De a documentação :

The load balancer uses a special cookie to track the instance for each request to each listener. When the load balancer receives a request, it first checks to see if this cookie is present in the request. If so, the request is sent to the instance specified in the cookie. If there is no cookie, the load balancer chooses an instance based on the existing load balancing algorithm. A cookie is inserted into the response for binding subsequent requests from the same user to that instance. The stickiness policy configuration defines a cookie expiration, which establishes the duration of validity for each cookie. The cookie is automatically updated after its duration expires.

If an instance fails or becomes unhealthy, the load balancer stops routing request to that instance, and chooses a new instance based on the existing load balancing algorithm. The request is routed to the new instance as if there is no cookie and the session is no longer sticky.

If a client switches to a different listener, stickiness is lost.

Então, isso depende da sua configuração do ELB e depende do que você define para o Período de Expiração para a viscosidade da sessão.

(Optional) In Expiration Period, enter the cookie expiration period, in seconds. After this period, the cookie is considered stale. If you do not specify an expiration period, the sticky session lasts for the duration of the browser session.

Portanto, se você não especificar um período de expiração, ele durará enquanto durar a sessão do PHP.

    
por 14.12.2015 / 07:30