http cookies
4 TopicsCollect and resend cookie headers and values in 307 POST redirect
Hi All, I am working on a solution to trigger a APM access policy logout and afterwards send the POST request with data and headers to the external website. The reason why I do this is quiet complex and I can explain this setup in another article. The issue is that the HTTP cookies and values are not being send to the external website. So I created the following Irule and when there is an APM allowed session and the URL /logmeout is triggered the session is closed and the client receives the redirect 307 with POST method and data, but the HTTP cookies are missing from the request. I was thinking to include a set cookie for each cookie but there are several cookies here which need to be resend. Is there perhaps an easier way to retrieve the original cookies and values store them in a variable and use it in the ACCESS::respond action? perhaps using the HTTP::cookie names method will that store all cookie names and values at once? when ACCESS_ACL_ALLOWED { if { [HTTP::uri] contains "/logmeout" } { log local0. "logout requested from IP [IP::client_addr] URI [HTTP::uri] query [HTTP::query]" ACCESS::session remove ACCESS::respond 307 Location "HTTPS://myredirectwebsite[HTTP::query]" } }598Views0likes1CommentCannot insert cookie
Hi all, I tried to do URI based pool selection on first request. Then sequence requests will be directed to the same pool even the URI doesn't match. I use simple codes like following, however, the cookie can't be inserted. We're using outdated 9.4.8... Would anyone please help? Thanks and rgds /ST Wong when HTTP_REQUEST { set myCheck 0 if {[HTTP::cookie exists "X-DWSpool"]} { pool test1-pool } else { switch -glob [string tolower [HTTP::uri]] { "/test1/*" { pool test1-pool set myCheck 1 } "/test2/*" { pool test2-pool } default { pool default-pool } } } } when HTTP_RESPONSE { if ($myCheck) { HTTP::cookie insert name "X-DWSpool" value "foo" path / } }430Views0likes8CommentsBIG-IP : iRule fails to find cookie
In Google Advanced REST Client , I send my GET request with headers : Cookie: special=1 My iRule has the following code : when HTTP_REQUEST { set cookie_special [HTTP::cookie value "special"] log local0. "cookie_special = $cookie_special" This logs as : cookie_special = So apparently F5 is not finding a cookie named "special". How can I further diagnose this issue ?427Views0likes6CommentsAdding spaces between semicolon seperated cookie elements
I'm using the following irule to add secure/httpOnly attributes to cookies: when HTTP_RESPONSE { foreach aCookie [HTTP::cookie names] { set ck_value [HTTP::cookie value $aCookie] set ck_path [HTTP::cookie path $aCookie] HTTP::cookie remove $aCookie HTTP::cookie insert name $aCookie value $ck_value path $ck_path version 1 HTTP::cookie httponly $aCookie enable HTTP::cookie secure $aCookie enable } } It's doing what I want but the resulting cookie looks like this with no spaces after the semicolons: Set-Cookie:.ASPXAUTH=xxxxxxxxxxxxxxxxxxx;Secure;HttpOnly;Path=/;Version=1; Everything is working as it should but not having a space after the semicolons makes it a little harder to read and I can't seem to find any info if no spaces is acceptable from a standards perspective. Can anyone tell me if having no spaces is ok from a standards / compatibility standpoint and if there is an easy way to add a space after each semicolon?401Views0likes1Comment