Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters
Answers

Only Apply Default Persistence Profile (HTTP Cookie Insert) to specific URI paths

Currently, we are using a Default Persistence Profile (HTTP Cookie Insert) on our Virtual Server. However, we only need persistence for a few paths on the site;

https://login.website.com/path1/*
https://login.website.com/path2/*
https://login.website.com/path3/*

Is it possible, using an iRule perhaps (?), to only apply a pre-defined persistency profile for specific paths, and not the entire Virtual Server?

Key point: I do NOT want to set/define the persistency options inline in the iRule. I would like to essentially reference a defined Persistency Profile ("Website-Cookie-Profile") from within the iRule.

Cookie Method: HTTP Cookie Insert
Cookie Name: ThisIsMyCookie
Always Send Cookie: (not selected)
Expiration: Session Cookie (selected)
Cookie Encryption Use Policy: preferred
Encryption Passphrase**: (masked)

Thanks in advance. Any example iRules would be greatly appreciated.

0
Rate this Question
Comments on this Question
Comment made 23-Feb-2018 by JQB 19

We are running BIG-IP LTM v12.1.2

0

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

iRule persist does not allow to chose user defined profile. You can only select persist type and specify all related parameters.

0
Comments on this Answer
Comment made 27-Feb-2018 by JQB 19

The below, thus far into my testing, is achieving the desired result.


when HTTP_REQUEST {
    # check for /path1/ in path
    switch -glob [string tolower [HTTP::path]] {
        "/path1/*" {
        # do nothing, i.e. inherit the default persistency profile (cookie persistency)
    }
     
    default { 
        # this matches ALL paths other than the above
        # do not use the ANY session persistency; this is to evenly spread the load across all web servers 
        persist none 
     }
   }
}
0