For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

DaveC_53879's avatar
DaveC_53879
Icon for Nimbostratus rankNimbostratus
May 06, 2011

cookie persistence sendfor: http only

Need help with cookie persistence. LTM version 9.4.6. How do I set the F5 cookie to http only?

14 Replies

  • No joy.

     

     

    May 13 13:29:18 tmm tmm[1711]: Rule http_only : 64.191.221.100:2156: Pool AA_sessiontest_pool

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2156: Current Set-Cookie: cookie_20=XyQIr5KAkKuQeqIk3Pa6bfE+YCnjQ/2h9I8arhY6nbqY27comZp4GIxhDBrMFGTy8z/YCxdndQFluXQ=; expires=Fri, 13-May-2011 17:49:19 GMT; path=/

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2158: Pool AA_sessiontest_pool

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2158: Current Set-Cookie: cookie_20=ewn7MZVX5vmp2oUk3Pa6bfE+YCnjQ2bAiX2zm7YxiPOqbOIuALBym5eBNHMR6W90ocDS7A7R8so94CE=; expires=Fri, 13-May-2011 17:49:19 GMT; path=/

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2158: Current Set-Cookie:

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2156: Current Set-Cookie:

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2158: Current Set-Cookie:

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2156: Current Set-Cookie:

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2163: Pool AA_sessiontest_pool

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2165: Pool AA_sessiontest_pool

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2164: Pool AA_sessiontest_pool

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2166: Pool AA_sessiontest_pool

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2158: Current Set-Cookie:

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only :64.191.221.100:2156: Current Set-Cookie:

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2163: Current Set-Cookie: cookie_20=skYHioWFBX16sTck3Pa6bfE+YCnjQxfwdp0xQQ0YKwBsP3Kn9fP07Sy550o0djwv3C+4y5cZGl/JgYc=; expires=Fri, 13-May-2011 17:49:19 GMT; path=/

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2165: Current Set-Cookie: cookie_20=Staj7MuqzlKDDx8k3Pa6bfE+YCnjQ5LdzGHasvVYsSSv4bdDIh3Lj42u3tohZvOrg7WfUDTanwDeKKQ=; expires=Fri, 13-May-2011 17:49:19 GMT; path=/

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2164: Current Set-Cookie: cookie_20=ygC7s4TV6J+uKIck3Pa6bfE+YCnjQwnPARjkFSReKH5tFENSJub3vXJ8eo2+ct1ZErFJ1NpNR3hdyDQ=; expires=Fri, 13-May-2011 17:49:19 GMT; path=/

     

    May 13 13:29:19 tmm tmm[1711]: Rule http_only : 64.191.221.100:2166: Current Set-Cookie: cookie_20=sw0yijTubs3Is0Mk3Pa6bfE+YCnjQ093u4KOQXSnrMlhgthQPGmUEroj3Ibo0JoXemwCsHpkrWtpmZE=; expires=Fri, 13-May-2011 17:49:19 GMT; path=/
  • Do you think appending every LTM cookie puts significant overhead on the LTM or am just not giving LTM enough credit?
  • Hi DaveC,

    [root@iris:Active] config  b virtual bar list
    virtual bar {
       snat automap
       pool foo
       destination 172.28.17.33:http
       ip protocol tcp
       persist mycookie
       profiles {
          myhttp {}
          tcp {}
       }
    }
    [root@iris:Active] config  b profile mycookie list
    profile persist mycookie {
       defaults from cookie
       mode cookie
       timeout 180
       cookie mode insert
       cookie name "cookie_20"
    }
    [root@iris:Active] config  b profile myhttp list
    profile http myhttp {
       defaults from http
       cookie secret "secret"
       encrypt cookies "cookie_20"
    }
    
    [root@iris:Active] config  curl -I http://172.28.17.33
    HTTP/1.1 200 OK
    Date: Sat, 15 Oct 2011 01:29:40 GMT
    Server: Apache/2.0.59 (rPath)
    Last-Modified: Sat, 11 Jun 2011 00:31:47 GMT
    ETag: "667a-67-cfb682c0"
    Accept-Ranges: bytes
    Content-Length: 103
    Vary: Accept-Encoding
    Content-Type: text/html; charset=UTF-8
    Set-Cookie: cookie_20=DtUT7p97+feyDIKi2OCuEWPqv0KMJRGoC16eEnwbcXGkonYaZHplZ51iBCel9egDDSZfSZ3TfeACgWg=; path=/
    
    [root@iris:Active] config  b rule myrule list
    rule myrule {
       when HTTP_RESPONSE {
       if {[HTTP::cookie "cookie_20"] ne ""}{
          HTTP::header replace Set-Cookie "[HTTP::header Set-Cookie]; HttpOnly"
       }
    }
    }
    
    [root@iris:Active] config  b virtual bar rule myrule
    
    [root@iris:Active] config  curl -I http://172.28.17.33
    HTTP/1.1 200 OK
    Date: Sat, 15 Oct 2011 01:30:02 GMT
    Server: Apache/2.0.59 (rPath)
    Last-Modified: Sat, 11 Jun 2011 00:31:47 GMT
    ETag: "667a-67-cfb682c0"
    Accept-Ranges: bytes
    Content-Length: 103
    Vary: Accept-Encoding
    Content-Type: text/html; charset=UTF-8
    Set-Cookie: cookie_20=BUuoH166ZBENSFCi2OCuEWPqv0KMJfEr2qRf+Svnu9S1feGWc/rkeJ1u1sm5yjRjoXdxLF6A8rvG0N4=; path=/; HttpOnly
    
    
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    In v11.0 you can use 'HTTP::cookie httponly $cookie_name enable' to set this flag:

    https://devcentral.f5.com/wiki/iRules.http__cookie.ashx

    
    when HTTP_RESPONSE { 
     
     Check if the response contains the persistence cookie 
    if {[HTTP::cookie BIGipServerMy_Http_Pool] ne ""}{ 
     
     Set the httponly flag on the persistence cookie if it is in the response
    HTTP::cookie httponly BIGipServerMy_Http_Pool enable
    } 
    }
    

    Aaron