Forum Discussion
Joern_Oltmann
Nimbostratus
Mar 08, 2016Possible to put parameter from an URL into a cookie?
Hi, it is possible to search on an URL to one or more parameters, and when the parameters are found, set a cookie with the value of the parameter?
Thanks for answer.
Joern
Brad_Parker_139
Nacreous
Mar 08, 2016Could be as simple as this. The request is http://your.domain.name/your/path?param1=this¶m2=that. The user would get session cookies param1CookieName=this and param2CookieName=that
when HTTP_REQUEST {
set param1Cookie [URI::query [string tolower [HTTP::uri]] param1]
set param2Cookie [URI::query [string tolower [HTTP::uri]] param2]
}
when HTTP_RESPONSE {
if {$param1Cookie ne ""}{
HTTP::cookie insert name param1CookieName value $param1Cookie
}
if {$param2Cookie ne ""}{
HTTP::cookie insert name param2CookieName value $param2Cookie
}
}
Joern_Oltmann
Nimbostratus
Mar 08, 2016Looks cool, I will try it.
Thx a lot.
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