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, 2014A user can have multiple cookies and each of those cookies can have separate values, so to say "looking for a value that should be present in a cookie", would indicate that you're looking for a cookie's value, without specifying which cookie to inspect.
I believe what that Netscaler config is doing is checking for the existence of the SMSESSION cookie itself in the request (not necessarily the value in that cookie), which in this case would be similar to the first example above.
when HTTP_REQUEST {
if { not ( [HTTP::cookie exists SMSESSION] ) } {
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