How to Configure Cookie Sticky configurations

I am new to F5. We have a requirement to configure Cookie sticky session. I believe i need to create “persistence” profile and configure Coockie methods but i am not sure what needs to be done…

does anyone in this group know how i can use the GUI to configure this?

thanks.

Hi Vim,

The simplest and most commonly used cookie persistence is cookie insert persistence with no timeout. With this profile added to a virtual server, LTM will insert its own cookie into responses whenever a load balancing decision is made. The cookie value is an encoding of the pool name and pool member IP and port. If you want to hide the pool name and/or IP:port, you can customize the cookie insert profile’s cookie name. You can also configure a custom HTTP profile with the custom persistence cookie name set in the HTTP profile field for cookies to encrypt.

It’s generally a best practice to use a custom OneConnect profile with cookie persistence. If you’re using SNAT on the VS, you can use a OneConnect profile source mask of 0.0.0.0. If you’re not using SNAT, then set the OC source mask to 255.255.255.255.

For details on this, you can check the LTM config guide on AskF5 for your version. I can post a sample config in a bit, if you want.

Aaron

Aaron,

Please post a sample configuration, that would be handy. I’m doing an F5 build for an application that requires cookie based load balancing with sticky bits enabled, so if a Server supporting an end-user session goes down, the web browser gets a hold of the cookie and automatically transfers the session to another Server behind the F5 (for the application) without forcefully logging out the end-user.

Thanks,

r_dynamo

Aaron,

Please post a sample configuration, that would be handy. I’m doing an F5 build for an application that requires cookie based load balancing with sticky bits enabled, so if a Server supporting an end-user session goes down, the web browser gets a hold of the cookie and automatically transfers the session to another Server behind the F5 (for the application) without forcefully logging out the end-user.

Thanks,

r_dynamo

Aaron,

Please post a sample configuration, that would be handy. I’m doing an F5 build for an application that requires cookie based load balancing with sticky bits enabled, so if a Server supporting an end-user session goes down, the web browser gets a hold of the cookie and automatically transfers the session to another Server behind the F5 (for the application) without forcefully logging out the end-user.

Thanks,

r_dynamo

Is your web tier stateless so that any web server can handle the user’s session? If so, I don’t think you need persistence on the client to web tier virtual server. If it is stateful, then I don’t think you’d be able to seemlessly transfer the user to a new web server.

Here’s a sample 10.2.x VS and cookie insert persistence profile config:

virtual http_10.1.0.15_vs {
   snat automap
   pool my_http_pool
   destination 10.1.0.15:http
   ip protocol tcp
   persist custom_cookie_insert
   profiles {
      http {}
      tcp {}
   }
}

profile persist custom_cookie_insert {
   defaults from cookie
   mode cookie
   cookie name "custom_cookie_insert"
}

Aaron