MAJOR: sample: pass a pointer to the session to each sample fetch function

Many such function need a session, and till now they used to dereference
the stream. Once we remove the stream from the embryonic session, this
will not be possible anymore.

So as of now, sample fetch functions will be called with this :

   - sess = NULL,  strm = NULL                     : never
   - sess = valid, strm = NULL                     : tcp-req connection
   - sess = valid, strm = valid, strm->txn = NULL  : tcp-req content
   - sess = valid, strm = valid, strm->txn = valid : http-req / http-res
diff --git a/include/proto/acl.h b/include/proto/acl.h
index 7cadfce..6b94296 100644
--- a/include/proto/acl.h
+++ b/include/proto/acl.h
@@ -99,7 +99,7 @@
  * function only computes the condition, it does not apply the polarity required
  * by IF/UNLESS, it's up to the caller to do this.
  */
-enum acl_test_res acl_exec_cond(struct acl_cond *cond, struct proxy *px, struct stream *strm, unsigned int opt);
+enum acl_test_res acl_exec_cond(struct acl_cond *cond, struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt);
 
 /* Returns a pointer to the first ACL conflicting with usage at place <where>
  * which is one of the SMP_VAL_* bits indicating a check place, or NULL if
diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h
index 361072e..4b64aca 100644
--- a/include/proto/proto_http.h
+++ b/include/proto/proto_http.h
@@ -126,10 +126,10 @@
 struct chunk *http_error_message(struct stream *s, int msgnum);
 struct redirect_rule *http_parse_redirect_rule(const char *file, int linenum, struct proxy *curproxy,
                                                const char **args, char **errmsg, int use_fmt);
-int smp_fetch_cookie(struct proxy *px, struct stream *strm, unsigned int opt,
+int smp_fetch_cookie(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
                      const struct arg *args, struct sample *smp, const char *kw, void *private);
 int
-smp_fetch_base32(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_base32(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
                  const struct arg *args, struct sample *smp, const char *kw, void *private);
 
 enum http_meth_t find_http_meth(const char *str, const int len);
diff --git a/include/proto/sample.h b/include/proto/sample.h
index 2880d00..02ccc52 100644
--- a/include/proto/sample.h
+++ b/include/proto/sample.h
@@ -30,11 +30,12 @@
 
 struct sample_expr *sample_parse_expr(char **str, int *idx, const char *file, int line, char **err, struct arg_list *al);
 struct sample_conv *find_sample_conv(const char *kw, int len);
-struct sample *sample_process(struct proxy *px, struct stream *strm,
-                              unsigned int dir, struct sample_expr *expr,
-                              struct sample *p);
-struct sample *sample_fetch_string(struct proxy *px, struct stream *strm,
-                                   unsigned int opt, struct sample_expr *expr);
+struct sample *sample_process(struct proxy *px, struct session *sess,
+                              struct stream *strm, unsigned int opt,
+                              struct sample_expr *expr, struct sample *p);
+struct sample *sample_fetch_string(struct proxy *px, struct session *sess,
+                                   struct stream *strm, unsigned int opt,
+                                   struct sample_expr *expr);
 void sample_register_fetches(struct sample_fetch_kw_list *psl);
 void sample_register_convs(struct sample_conv_kw_list *psl);
 const char *sample_src_names(unsigned int use);
diff --git a/include/proto/stick_table.h b/include/proto/stick_table.h
index 9beaa54..11b98df 100644
--- a/include/proto/stick_table.h
+++ b/include/proto/stick_table.h
@@ -47,7 +47,7 @@
 struct stksess *stktable_lookup_key(struct stktable *t, struct stktable_key *key);
 struct stksess *stktable_update_key(struct stktable *table, struct stktable_key *key);
 struct stktable_key *smp_to_stkey(struct sample *smp, struct stktable *t);
-struct stktable_key *stktable_fetch_key(struct stktable *t, struct proxy *px,
+struct stktable_key *stktable_fetch_key(struct stktable *t, struct proxy *px, struct session *sess,
                                         struct stream *strm, unsigned int opt,
                                         struct sample_expr *expr, struct sample *smp);
 int stktable_compatible_sample(struct sample_expr *expr, unsigned long table_type);
diff --git a/include/proto/stream.h b/include/proto/stream.h
index 4d23470..1cd506a 100644
--- a/include/proto/stream.h
+++ b/include/proto/stream.h
@@ -48,7 +48,7 @@
 void sess_change_server(struct stream *sess, struct server *newsrv);
 struct task *process_stream(struct task *t);
 void default_srv_error(struct stream *s, struct stream_interface *si);
-struct stkctr *smp_fetch_sc_stkctr(struct stream *l4, const struct arg *args, const char *kw);
+struct stkctr *smp_fetch_sc_stkctr(struct session *sess, struct stream *strm, const struct arg *args, const char *kw);
 int parse_track_counters(char **args, int *arg,
 			 int section_type, struct proxy *curpx,
 			 struct track_ctr_prm *prm,