Forum Discussion
BigBunk390_1180
Nimbostratus
May 21, 2014iRule to redirect if value does not exist in cookie
Hello, I am trying to create an irule that check the users cookie for a value and if the value does not exist it should redirect the user to a different url.
Something similar to this:
when...
Kevin_Stewart
Employee
May 21, 2014Are you looking for the presence of a cookie in the request:
when HTTP_REQUEST {
if { not ( [HTTP::cookie exists MYCOOKIE] ) } {
HTTP::redirect "https://differenturlloginpage.com"
}
}
Or for some value in a known cookie:
when HTTP_REQUEST {
if { not ( [HTTP::cookie value MYCOOKIE] contains "somevalue" ) } {
HTTP::redirect "https://differenturlloginpage.com"
}
}
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