[MINOR] cookie: add support for the "preserve" option

This option makes haproxy preserve any persistence cookie emitted by
the server, which allows the server to change it or to unset it, for
instance, after a logout request.
(cherry picked from commit 52e6d75374c7900c1fe691c5633b4ae029cae8d5)
diff --git a/src/proto_http.c b/src/proto_http.c
index 3a2be18..a5e6e16 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -5098,6 +5098,7 @@
 		 * 6: add server cookie in the response if needed
 		 */
 		if ((t->srv) && (t->be->options & PR_O_COOK_INS) &&
+		    !((txn->flags & TX_SCK_FOUND) && (t->be->options2 & PR_O2_COOK_PSV)) &&
 		    (!(t->flags & SN_DIRECT) ||
 		     ((t->be->cookie_maxidle || txn->cookie_last_date) &&
 		      (!txn->cookie_last_date || (txn->cookie_last_date - date.tv_sec) < 0)) ||
@@ -6780,7 +6781,12 @@
 				 * We'll delete it too if the "indirect" option is set and we're in
 				 * a direct access.
 				 */
-				if (((t->srv) && (t->be->options & PR_O_COOK_INS)) ||
+				if (t->be->options2 & PR_O2_COOK_PSV) {
+					/* The "preserve" flag was set, we don't want to touch the
+					 * server's cookie.
+					 */
+				}
+				else if (((t->srv) && (t->be->options & PR_O_COOK_INS)) ||
 				    ((t->flags & SN_DIRECT) && (t->be->options & PR_O_COOK_IND))) {
 					/* this cookie must be deleted */
 					if (*prev == ':' && next == hdr_end) {