F5'de iRule ile Cookie Ekleme

F5'de iRule ile her response'da cookie eklemeye çalışırken HttpOnly eklemek istediğimde yapılması gereken şey sadece HTTP::cookie httponly $cookieName enabled yazmak olduğunu düşünüyordum. HttpOnly cookieler sadece version 1 veya version 2 tip cookielerde çalışıyormuş. Siz değer belirtmedikce F5 default olarak version 0 cookie yaratıyor.

Aşağıdaki iki yöntemden biri ile yapabilirsiniz.

when HTTP_RESPONSE {
    set cookieName "myCookie"
    set cookieValue "true"
    HTTP::cookie insert name ${cookieName} value "${cookieValue}" path {/} domain {.devopstr.com}
    HTTP::cookie version ${cookieName} 1
    HTTP::cookie secure ${cookieName} enabled
    HTTP::cookie httponly ${cookieName} enabled
}

Aralarında fark olarak yazım farkı dışında bir fark bulunmuyor.

when HTTP_RESPONSE {
    set cookieName "myCookie"
    set cookieValue "true"
    HTTP::header insert "Set-Cookie" "${cookieName}=${cookieValue};path=/;domain=.devopstr.com;Secure; HttpOnly"
}

Bir de cookie yazamadığı zaman hata verip hiç çalışmaması yerine, sadece cookie değeri boş gelse çok güzel olucakmış.

Subscribe to DevOps TR

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe