Forum Discussion
12 Replies
- Brad_ParkerCirrus
Absolutely possible. Are you wanting to send cookies back to the client in the response with the values they supplied in the request?
- Joern_OltmannNimbostratusExactly :-) Do you have an example for me or an URL with the information how it is possible? Would be great !
- Brad_Parker_139Nacreous
Absolutely possible. Are you wanting to send cookies back to the client in the response with the values they supplied in the request?
- Joern_OltmannNimbostratusExactly :-) Do you have an example for me or an URL with the information how it is possible? Would be great !
- Brad_Parker_139Nacreous
Could 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_OltmannNimbostratusLooks cool, I will try it. Thx a lot.
- Brad_ParkerCirrus
Could 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_OltmannNimbostratusLooks cool, I will try it. Thx a lot.
- Joern_OltmannNimbostratus
Hi Brad, the iRule works fine if you have no redirect. But we need also the cookies for a redirect. So the cookies must be insert in the location header
For example: is redirected to "Location " but we need the following Location "Location "
Also if the lacation url has no parameter it must look like these
"Location &cusid=123456&comid=654321"
Does anyone have a suggestion for me??
- Joern_OltmannNimbostratus
If anyone interested, I found the solution:
when HTTP_REQUEST {
set param_domain [domain [HTTP::host] 2] set param_wlw_comid [URI::query [string tolower [HTTP::uri]] comid] set param_wlw_cusid [URI::query [string tolower [HTTP::uri]] cusid]
}
when HTTP_RESPONSE {
if { ($param_wlw_comid ne "") and ($param_domain ne "") }{ HTTP::cookie insert name wlw_comid value $param_wlw_comid path "/" domain $param_domain HTTP::cookie expires wlw_comid 31557600 } if { $param_wlw_cusid ne "" and ($param_domain ne "") }{ HTTP::cookie insert name wlw_cusid value $param_wlw_cusid path "/" domain $param_domain HTTP::cookie expires wlw_cusid 31557600 }
}
- Joern_OltmannNimbostratus
If anyone interested, I found the solution:
when HTTP_REQUEST {
set param_domain [domain [HTTP::host] 2] set param_wlw_comid [URI::query [string tolower [HTTP::uri]] comid] set param_wlw_cusid [URI::query [string tolower [HTTP::uri]] cusid]
}
when HTTP_RESPONSE {
if { ($param_wlw_comid ne "") and ($param_domain ne "") }{ HTTP::cookie insert name wlw_comid value $param_wlw_comid path "/" domain $param_domain HTTP::cookie expires wlw_comid 31557600 } if { $param_wlw_cusid ne "" and ($param_domain ne "") }{ HTTP::cookie insert name wlw_cusid value $param_wlw_cusid path "/" domain $param_domain HTTP::cookie expires wlw_cusid 31557600 }
}
- Joern_OltmannNimbostratus
If anyone interested, I found the solution:
when HTTP_REQUEST {
set param_domain [domain [HTTP::host] 2] set param_wlw_comid [URI::query [string tolower [HTTP::uri]] comid] set param_wlw_cusid [URI::query [string tolower [HTTP::uri]] cusid]
}
when HTTP_RESPONSE {
if { ($param_wlw_comid ne "") and ($param_domain ne "") }{ HTTP::cookie insert name wlw_comid value $param_wlw_comid path "/" domain $param_domain HTTP::cookie expires wlw_comid 31557600 } if { $param_wlw_cusid ne "" and ($param_domain ne "") }{ HTTP::cookie insert name wlw_cusid value $param_wlw_cusid path "/" domain $param_domain HTTP::cookie expires wlw_cusid 31557600 }
}