16-Jan-2014
10:50
- last edited on
02-Jun-2023
10:42
by
JimmyPackets
is there a way to post back a URL to a web application.. i have an irule that handles a logout event but i also need to post back to a secondary application to kill a session there. the secondary appliction is waiting for the following post back -
http://serverA:8080/SecondApp/logon/logoff.do
Current, logout irule -
if { [ string tolower [HTTP::uri]] equals "/firstapp/logout" } {
ACCESS::session remove
ACCESS::respond 302 Location "https://[HTTP::host]" "Set-Cookie" "MRHSession=0; expires=Tuesday, 29-Mar-1970 00:15:00 GMT" "Connection" "Close"
}
16-Jan-2014
16:42
- last edited on
02-Jun-2023
10:42
by
JimmyPackets
Try this (not tested but you should get the general idea;
when CLIENT_ACCEPTED {
set fLogout 0
}
when HTTP_REQUEST {
if { [ string tolower [HTTP::uri]] equals "/firstapp/logout" } {
if {$fLogout} {
ACCESS::session remove
ACCESS::respond 302 Location "https://[HTTP::host]" "Set-Cookie" "MRHSession=0; expires=Tuesday, 29-Mar-1970 00:15:00 GMT" "Connection" "Close"
return
} else {
Save request details for use in HTTP_RESPONSE
set $req [HTTP::request]
set flag
set fLogout 1
Execute second logout first 1.1.1.1 is address of serverA
node 1.1.1.1 80
HTTP::uri "/SecondApp/logon/logoff.do"
}
}
}
when HTTP_RESPONSE {
if {$fLogout} {
Retry original request
set fLogout 0
HTTP::retry $req
}
}