# Haproxy SSL and sessions

**URL:** https://discourse.haproxy.org/t/haproxy-ssl-and-sessions/1377
**Category:** Help!
**Created:** [June 26, 2017, 10:50am UTC](https://discourse.haproxy.org/t/haproxy-ssl-and-sessions/1377 "2017-06-26T10:50:19Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mandevnull](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mandevnull](https://discourse.haproxy.org/u/mandevnull)
#### Post date: [June 26, 2017, 10:50am UTC](https://discourse.haproxy.org/t/haproxy-ssl-and-sessions/1377/1 "2017-06-26T10:50:19Z")

</div>

Hello,  
i’m trying to configure 2 backends (citrix storefront) active-active with haproxy. Backends are in https. When i log in node1 and i disconnect the node for test the node2, haproxy not “save” the credentials and i have to log in again. Is it possible to save sessions and pass them to node2 when node1 fails? I have tested several configurations in both tcp mode and http mode

Examples:

http mode:  
[…]  
bind 0.0.0.0:443 ssl crt /etc/pki/tls/private/mycert.pem  
[…]  
backend mybackend  
mode http  
cookie SRVNAME insert  
server node1 192.168.1.1:443 ssl check cookie app1  
server node2 192.168.1.2:443 ssl check cookie app1

tcp mode:  
[…]  
mode tcp  
bind 0.0.0.0:443  
[…]  
backend mybackend  
mode tcp  
server node1 192.168.1.1:443  
server node2 192.168.1.2:443

thank you so much

---

<div class="post-metadata">

### Author: ![mandevnull](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mandevnull](https://discourse.haproxy.org/u/mandevnull)
#### Post date: [June 26, 2017, 10:57am UTC](https://discourse.haproxy.org/t/haproxy-ssl-and-sessions/1377/2 "2017-06-26T10:57:53Z")

</div>

sorry i have a mistake with copy&paste

server node1 192.168.1.1:443 ssl check cookie app1  
erver node2 192.168.1.2:443 ssl check cookie app2

---

<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: [June 26, 2017, 11:54am UTC](https://discourse.haproxy.org/t/haproxy-ssl-and-sessions/1377/3 "2017-06-26T11:54:48Z")

</div>

> [@mandevnull](#):
>
> Is it possible to save sessions and pass them to node2 when node1 fails?

No, haproxy cannot write to your backend databases.

---

<div class="post-metadata">

### Author: ![mandevnull](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mandevnull](https://discourse.haproxy.org/u/mandevnull)
#### Post date: [June 26, 2017, 12:43pm UTC](https://discourse.haproxy.org/t/haproxy-ssl-and-sessions/1377/4 "2017-06-26T12:43:15Z")

</div>

oh… ok thanks  
and with http? without encryption?

thanks

---

<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: [June 26, 2017, 1:23pm UTC](https://discourse.haproxy.org/t/haproxy-ssl-and-sessions/1377/5 "2017-06-26T13:23:23Z")

</div>

It doesn’t matter.

Haproxy can use stickiness to make sure one browser session always hits the same server, but it cannot synchronize your backends with each other.

I strongly suggest you talk to your application people.

---

<div class="post-metadata">

### Author: ![mandevnull](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@mandevnull](https://discourse.haproxy.org/u/mandevnull)
#### Post date: [June 27, 2017, 7:23am UTC](https://discourse.haproxy.org/t/haproxy-ssl-and-sessions/1377/6 "2017-06-27T07:23:15Z")

</div>

ok thank you very much
