Forum Discussion

Dmitriy_Tiper's avatar
Icon for Altocumulus rankAltocumulus
Jun 14, 2024

Cookie insert via http:redirect - can it be configured "secure"?

Using slightly changed example from DevCentral I am able to insert cookie on http redirect


set cookie [format "orig_lang=french; path=/;"]
  if { [HTTP::host] equals "" } 
     # Redirect to the requested host and URI (minus the port if specified)
     HTTP::respond 302 Location "" "Set-Cookie" $cookie
Is it possible configure secure and httponly on that cookie?
Thank you in advance.

4 Replies

  • yeah agree with Paulius, it should be possible. im not quite sure why you haven't just tried and see, seems easier then asking. or are you also asking how?

  • I did try iRule in my initial question and it works in terms of insertion of a cookie. May be I was unclear in what I am asking :) Yes, I am asking "how" - i.e. iRule syntax to allow this cookie also to be secure and httponly.

    • boneyard's avatar
      Icon for MVP rankMVP

      Add this to your cookie string (set cookie ...) and you should be ok:

      ; secure; HttpOnly