Home > How-to Guides > How to Configure a session cookie persistence profile for F5 Load Balancer

How to Configure a session cookie persistence profile for F5 Load Balancer


Topic
You can configure a cookie persistence profile that uses session cookies. A session cookie is a transient cookie that is erased when the client browser session is closed. The session cookie is typically stored in temporary memory on the client system. One advantage to configuring a session cookie persistence profile is that a session cookie will not expire after a timeout period; the session cookie expires when the browser is closed.
Note: Some browsers implement a session restore feature that saves your browser session data after the system becomes unresponsive. The browser data is stored on the client system hard drive and restored when the browser is restarted.


Description

You can configure the session cookie persistence in F5 through the UI or through shell

 

OPTION 1 : Using the Configuration utility to configure a session cookie persistence profile

  1. Log in to the Configuration utility.
  2. Navigate to Local Traffic > Profiles.
  3. Click the Persistence menu.
  4. Click Create.
  5. Type a name for the profile.
  6. From the Persistence Type menu, select Cookie.
  7. In the Configuration section, select the check box next to Cookie Method.
  8. Choose either HTTP Cookie Insert, or HTTP Cookie Rewrite.
  9. Select the check box next to Expiration.
  10. Ensure that Session Cookie is checked.
  11. Click Finished.

 

OPTION 2: Using the tmsh utility to configure a session cookie persistence profile

  1. Log in to the Traffic Management Shell (tmsh) by typing the following command:

tmsh

  1. To configure a cookie persistence profile using Session Cookie and the default method type of HTTP Cookie Insert, use the following command syntax:

create /ltm persistence cookie <name of profile> defaults-from cookie

For example:

create /ltm persistence cookie cookie_one defaults-from cookie

  1. To configure a cookie persistence profile using Session Cookie and a method type of HTTP Cookie Rewrite, use the following command syntax:

create /ltm persistence cookie <name of profile> defaults-from cookie method rewrite

For example:

create /ltm persistence cookie cookie_one defaults-from cookie method rewrite

  1. To save the new configuration, type the following command:

save /sys config

You must now associate the new persistence profile with the virtual server.

 

Note: For more information about the different types of HTTP cookie persistence you can configure your BIG-IP system to use, refer to the Cookie persistence section in the Enabling Session Persistence chapter of the Configuration Guide for BIG-IP Local Traffic Manager.

Note: For information about how to locate F5 product guides, refer to K12453464: Finding product documentation on AskF5.

Feedback? Login to give feedback on this article.


Reference

K7168: Configuring a session cookie persistence profile

https://support.f5.com/csp/article/K7168

K83419154: Overview of cookie persistence

https://support.f5.com/csp/article/K83419154

 

Original Publication Date: May 17, 2007
Updated Date: Sep 22, 2017