Forum Discussion
Daniel_Tremmel
Altostratus
Jun 04, 2014APM iRule Event: insert Cookie after Logon Page
Hi all,
following situation: when a user wants to access an application server, the user has to authenticate via Active Directory. Then a cookie with the username and a random number will be added ...
kunjan
Nimbostratus
Jun 10, 2014I noticed the earlier rule though inserted the cookie to application server in the first request, there were 2 cookie headers.
Cookie: F5_ST=1z1z1z1402414804z604800; LastMRH_Session=a66fdead;
Cookie: MyCookie=MyValue;I guess, application server picked the first cookie and couldn't find the one it was looking for.
Set-Cookie is the request to the browser to store the cookie.
Try the amended rule.
when HTTP_REQUEST {
set flag 0
if { [HTTP::cookie MyCookie] ne "" }{
set flag 1
}
}
when ACCESS_ACL_ALLOWED {
if { $flag eq 0 }{
HTTP::header replace "Cookie" "[HTTP::header "Cookie"]; MyCookie=MyValue"
}
}
when HTTP_RESPONSE {
if { $flag eq 0 }{
HTTP::header insert "Set-Cookie" "MyCookie=MyValue;path=/"
}
unset flag
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
