Forum Discussion
Brent_Sachnoff_
Nimbostratus
Oct 23, 2007Using switch with uri
I'm having some issues using the switch command and uri's. I believe the switch command is only for EQUALS to something for it to work properly which means this wouldn't work at all. Here is a sample...
hoolio
Cirrostratus
Oct 31, 2007Actually, I'm not sure that setting the path in the HTTP_REQUEST event will work as the cookie hasn't been inserted yet. If you're able to test, and it doesn't work in HTTP_REQUEST, can you try setting the path in HTTP_RESPONSE?
To do so, you could set a path variable in the switch and then reference that in the HTTP_RESPONSE event:
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
/cc/* {
set path cc
do other things
}
rest of switch checks
default {
set path none
do other things
}
}
}
when HTTP_RESPONSE {
if {HTTP::cookie exists $path}{
HTTP::cookie path $path "/$path"
}
}Aaron
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