Forum Discussion
Rusty_Hale_8009
Nimbostratus
Apr 26, 2005Grab cookie contents and insert it as another.
I want to grab the contents of a cookie (from an http post) and insert that value into a new cookie with a different name. This is what I have so far that will not pass syntax:
when HT...
Apr 27, 2005
Looks like this may be catching on another non-POST request. Give this a try
when HTTP_REQUEST {
if { [HTTP::header exists "Content-Length"] } {
set clen [HTTP::header Content-Length]
log "found Content-Length: $clen"
if { $clen > 0 } {
HTTP::collect $clen
}
}
}
when HTTP_REQUEST_DATA {
set authuser [findstr [HTTP::payload] "txtUsername=" 12 "&"]
log "txtUserName Value: $authuser"
}
This will only try to extract the Content-Length header if it exists and will only call HTTP::collect if the value is greater than zero. I've also removed the $clen from the HTTP::payload command as it will return the amount collected which is what was indicated int he HTTP::collect command.
Hopefully this gets it...
-Joe
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