Forum Discussion
Migrated to VE F5 version 12 and now iRule inserting double quotes
We recently migrated from the Physical F5 to the virtual edition. Most of the transition went well. We have an iRule that will pull the SAML information and then create a cookie that is used by an application for access. The cookie when it is displayed by the Web browser should have single quotes around the information, such as Cookie_name "cookie_info" Now that we switched over to the Virtual edition F5 the cookie has double quotes such as Cookie_name ""cookie_info"" I need to remove the extra quotes. It has been suggested that I use the string trim command, however I am new to iRule writing and am not sure how I would say to the system to remove the quotes from the cookie. Could someone please give me some guidance on how to remove the quotes?
Thanks
12 Replies
Please post your iRule (the cookie related sections) to this forum. This will help us to understand where the double-quotes are comming from and allows us to finally propose a workaround...
Cheers, Kai
Note: The TCL [string trim $input "\""] command is not able to remove a single quote. It willremove every leading and trailing quotes. The TCL [string map {"\"\"" "\"" } $input] command may be used instead to simply replace double quotes with single quotes.
Cheers, Kai
- Paul_Lueders
Altostratus
the sample section is catch { if { [ACCESS::session data get session.saml.last.result] == "1" && [ACCESS::session data get session.saml.last.name.test] != "" && [ACCESS::session data get session.last.attr.name.sample] != "" && $attributes != ""} { HTTP::cookie insert name "monster" value "session=$session :: user=$user :: Org=$test :: secOrg= :: whoami=$name" path "/" }
When the monster cookie is created it is surrounded by ""cookie"" I need to remove the second set of quotes.
Hi Paul,
the iRule snipped looks valid for me and should not wrap the cookie value in double quotes. Which iRule event are you using for this iRule so that I can verify your observations?
As a workaround you could also switch to a
syntax to issue the cookie...[HTTP::header insert]
HTTP::header insert "Set-Cookie" "monster=\"session=$session :: user=$user :: Org=$test :: secOrg= :: whoami=$name\"; Path=/"
Cheers, Kai
- Paul_Lueders
Altostratus
Thank you for the suggestion. At this time I am not using anything to check the irule. I am open to suggestions. As I am always willing to learn more and more about the F5 and iRules.
Did my previous answer solved your problem?
Cheers, Kai
- Paul_Lueders
Altostratus
Sir unfortunately it did not, I am getting the same results.
Thanks Paul
Hi Paul,
I would recommend to rule out the differences in browsers by just looking at the wire with tools like Fiddler or HTTPWatch. Your F5 will send it always the same way regardless of the used browser. If this format is correct but somehow a specific browser will double-quote the value it would be a fault of the browser then...
So if possible post the complete HTTP-Response where the Cookie is send to the client and wildcard/remove as little sensitive information as possible.
Cheers, Kai
- Paul_Lueders
Altostratus
I will work on this. Thanks
- Paul_Lueders
Altostratus
One new observation. when I access the website using IE the cookie is surrounded buy a single quote, however when I access the same page using Firefox the cookie is surrounded by double quotes. Curious.
Recent Discussions
Related Content
* 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