Cookie / JSESSIONID naming confusion

Hello,

Apologies for the simple question but I was not able to find an answer.
I have a config that directs data based on jsessionid, I have two backends determined by an ACL.
Does the cookie name have to be the same as the server name or do they just have to be unique?

frontend fe_connector_443
    bind *:443 ssl crt /etc/ssl/private/cert.pem alpn h2,http/1.1
    option h1-case-adjust-bogus-client
    mode http
    capture cookie JSESSIONID= len 32
    option forwardfor
    acl internal_range src 192.168.0.0/16
    use_backend internal_source_be if internal_range
    default_backend external_source_be

backend external_source_be
    mode http
    balance roundrobin
    cookie JSESSIONID prefix indirect nocache
    server awc-01 192.168.30.11:443 check cookie s1 verify none ssl alpn h2,http/1.1 
    server awc-03 192.168.30.12:443 check cookie s3 verify none ssl alpn h2,http/1.1 

backend internal_source_be
    mode http
    balance roundrobin
    cookie JSESSIONID prefix indirect nocache
    server awc-02 192.168.30.13:443 check cookie s2 verify none ssl alpn h2,http/1.1

Also do they have to be unique per backend or overall?

Thanks

I would recommend the cookie name to be unique per backend, otherwise you may get a clash when a client uses more than a single backend, as one backend would overwrite the other.

The cookie value (which is defined per server) is not related to the server name. It usually needs to be unique (if the sessions must stick to the same server), however it could be a duplicate for example when you have specific backup servers definied, like:

backend applicationblue
 cookie SESSIONIDAPPBLUE prefix indirect nocache
 server s1 192.168.0.1 cookie s1
 server s1backup 192.168.1.1 backup cookie s1
 server s2 192.168.0.2 cookie s2
 server s2backup 192.168.1.2 backup cookie s2
 server s3 192.168.0.3 cookie s3
 server s3backup 192.168.1.3 backup cookie s3