Forum Discussion

Abed_AL-R's avatar
Abed_AL-R
Icon for Cirrostratus rankCirrostratus
Jan 02, 2019

set timeout for cookie hash persistence in irule

Hi

I;m trying to set timeout value for "persist cookie hash" in irule but somehow the irule is not accepting the syntax

switch -glob [string tolower [HTTP::path]] {

    "/oauth*" {
        pool P1_Pool

         }
    "/lmsserver*"
     {
      pool P2_Pool 
      **persist cookie hash "Stickcookie"** <<<< 
    }

I tried the following :

persist cookie hash "Stickcookie" 0 0 28800

but f5 error then appears:

01070151:3: Rule [/Common/URI_blabla] error: /Common/URI_blabla:15: error: ["invalid argument 0"][persist cookie hash "Stickcookie" 0 0 28800]
  • nevermind, I figured out how the syntax. It should be lik this:

    persist cookie hash "Stickcookie" { 0 0 } 28800
    
  • If not setting an offset or length, you can just use

    persist cookie hash Stickcookie 28800