How to get cookie value set by HAproxy

I’ve got HAproxy set up for a WE app with the help of John Joyce instructions for load balancing.
HAproxy sets a cookie called “serverid” that contains the proxy node the user is connected to as shown in the image below.
I’m trying to get that value from the app by using:

s = Session.Cookies.Value("serverid")

This returns nothing at all. I guess it’s because the app itself did not set this cookie value?
Any ideas on how to retrieve the value from “serverid”? :slight_smile:

Thank you.

Got it working by executing a javascript that sets the apps HashTag to the value of “serverid”.
In the Session.HashTagChanged event I treat it with care :slight_smile:

If someone needs it.


<script type="text/javascript">

  // Original JavaScript code by Chirp Internet:
  // Please acknowledge use of this code by including this header.

  function getCookie(name)
    var re = new RegExp(name + "=([^;]+)");
    var value = re.exec(document.cookie);
    return (value != null) ? unescape(value[1]) : null;


Call the funktion with:


Then you can get the value of the cookie in Session.HashTagChanged event.