# Force Sticky session on HaProxy

**URL:** <https://discourse.haproxy.org/t/force-sticky-session-on-haproxy/1826>\
**Category:** Help!\
**Created:** [November 27, 2017, 12:28am UTC](https://discourse.haproxy.org/t/force-sticky-session-on-haproxy/1826 "2017-11-27T00:28:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DevendraJoshi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/devendrajoshi/32/309_2.png) [@DevendraJoshi](https://discourse.haproxy.org/u/DevendraJoshi)\
**Post date:** [November 27, 2017, 12:28am UTC](https://discourse.haproxy.org/t/force-sticky-session-on-haproxy/1826/1 "2017-11-27T00:28:59Z")

</div>

Hi,

Is anybody configured Force Sticky session in Haproxy (with JSESSIONID).

I am using following things  
Centos 6.4  
Apache 2.2  
Jboss 4.0  
ModJK  
and HaProxy 1.6.12

also check following setting in ModJK config but not succeed.

cookie serverid insert indirect nocache  
stick-table type string len 36 size 1m expire 8h  
stick on cookie(JSESSIONID)

I want to configure this on HaProxy level.  
If my one web-server goes down then client should not get disconnect , should wait for the web-server get up.  
If server get up withing time then client start communicating.

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [December 4, 2017, 5:49pm UTC](https://discourse.haproxy.org/t/force-sticky-session-on-haproxy/1826/2 "2017-12-04T17:49:59Z")

</div>

Use “option persist”:

[https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#option%20persist](https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#option%20persist)

---

<div class="post-metadata">

**Author:** ![DevendraJoshi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/devendrajoshi/32/309_2.png) [@DevendraJoshi](https://discourse.haproxy.org/u/DevendraJoshi)\
**Post date:** [December 7, 2017, 5:06am UTC](https://discourse.haproxy.org/t/force-sticky-session-on-haproxy/1826/3 "2017-12-07T05:06:33Z")

</div>

Its not working

check my haproxy config.
