Forum Discussion
Kai_Wilke
Dec 17, 2015MVP
Hi Kai,
instead of using
[substr [ HTTP::uri ] 1]
(aka. striping the first character) in combination with "foo/" you may want to use just [HTTP::uri]
in combination with "/foo/". Both will work, but the later one will save you some CPU cycles.
instead of using
[string map {"/bar/" "/"} [HTTP::uri]]
you may want to use [string range [HTTP::uri] 4 end]
, where "4" represents the number of trailing chars to be removed. Again... both will work, but the later one will save some additional CPU cycles.
The cookie based routing problem you're experincing, is almost impossible to fix using multiple independend cookie_names. I would recommend to change your cookie based routing logic to use an additional "cookie_name" for both subsites. The value of this cookie would then contain the needed routing (e.g. either "foo" or "bar"). The cookie could be insert by your backend servers or using an
HTTP_RESPONSE
iRule at the time the user visits the URI /foo or /bar. To move between the different subsites, you have to make sure the user visits the URI /foo or /bar initially, to get the new cookie value.
Cheers, Kai