Forum Discussion
Trying to write information to a persistence cookie
I'm trying to write to the client SIP to the "unused" field in a persistence cookie I used the lines below to read info out of the cookie (from Dev Central)
scan [HTTP::cookie $current_cookie] {%[^\.].%d.%d} myIpE myPortE unused
log local0. "myIpD=$myIpE myPortE=$myPortE unused=$unused"I tried the code below to write the client SIP but by all indications (looking inside the cookie) I have not broken the code..Any ideas would be welcome. The code I tried to write with is below. I commented a few of my attempts to get this working as they showed errors in the irule editor. I am able to encode the address...but I cant get it written to the cookie..
set addr "$clientip"
scan $addr "%u.%u.%u.%u" a b c d
log local0. "the Decimal Client IP and port is $addr"
set cookie_SIP "[expr ($d<<24)|($c<<16)|($b<<8)|$a]"
log local0. "the Hashed Value for the Client IP is $cookie_SIP" --
HTTP::cookie insert name "BIGipServerFP_pool" value $cookie path "/"
HTTP::cookie $current_cookie insert $client1p "/unused"1 Reply
- Kevin_Stewart
Employee
At the very least the HTTP::cookie insert syntax on the last line is incorrect. It should be something like this:
HTTP::cookie insert name [cookie name] value [cookie value] path [cookie path] ex. HTTP::cookie insert name MYCOOKIE value "blah" path "/"
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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