Forum Discussion
Joe_D_Rozario_4
Nimbostratus
Jul 29, 2008Header values with curly bracktes problem
I would really appreciate some help in changing http headers.
Objective: I have to change the date format of the cookies having PDT to GMT.
I tried to access cookie "expire" attribute by [HTTP::cookie expires "cookie name" but get nothing even though cookie has expires value.
If [HTTP::cookie exists "Expires"] a value is retrieved but for only one cookie only. Consequently, only one cookie get modified if I loop through the cookie list (set cookie_list [HTTP::cookie names]).
So, gave up trying to modify cookie through HTTP::cookie and started to use HTTP::header thinking just to change PDT to GMT and ignoring 8 hour discrepancy.
Used [HTTP::header values "Set-Cookie"] to get the string but it has lots of curly brackets like this, {SESSION_ID=50023976835%2CP0Q%2BPEorXy1MN08%2FXiJcTl07SiNSIUg8I1pVSyg3RyRHIlQ1NClEPU8sUCQh; Expires=Tue, 12 Aug 2008 09} 12 {21 GMT; Path=/} {cart=3; Expires=Wed, 13 Aug 2008 09} 12 {21 GMT; Path=/}
This makes the substitution difficult. If I leave the curly brackets and try to replace the header then it creates a new one with the curly brackets.
What are these brackets for and how to filter them out.
Thanks
Joe
- Nicolas_Menant
Employee
[Duplicated entry...] - Nicolas_Menant
Employee
Hi,when HTTP_RESPONSE { foreach aCookieName [HTTP::cookie names] { set cookie_val [HTTP::cookie value $aCookieName] HTTP::cookie $aCookieName "[string map {PDT GMT} $cookie_val]" } }
- Joe_D_Rozario_4
Nimbostratus
Thanks for your response. I have used similar code to what you have provided. - hoolio
Cirrostratus
Can you post the full response headers for one response?
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects