Forum Discussion

Mark_Stradling_'s avatar
Oct 30, 2014

Whitespace in cookie

I've run into an issue where cookie parsing is failing. We have a couple cookies that contain a whitespace character. It seems [HTTP::cookie names] parses by looking for whitespace characters. Here is an example:

 

{"cp":{"userid":"","pagetype":"Home_page","url":"http://www.test.com/","genre":"All tickets","genreid":"0","event":"default","eventid":"default","value11":"","valuexx":"47","pgeo":"","ipgid":"","salemethod":"'null'","price":"'null'","fee":"","TT_variant":"","TLSessionID":"05A0BF36605A10609120EC8EF5EA7DED"},"v2":-2,"v1":1,"rid":"d036702-53049962-1cbe-fb41-062d7","to":3.1,"c":"http://www.test.com/","pv":3,"lc":{"d0":{"v":3,"s":false}},"cd":0,"f":1414690510105}

 

there is a space between ALL and tickets.

 

I've tried to do some creative parsing using HTTP::header and split, but then I cannot act upon the cookie to clean it of spaces because when I try to reference the cookie using the name I parsed from the header, it will fail because the [HTTP::cookie] command fails.

 

I've already requested that the app owner fixes the cookie but I am trying to mitigate the impact in the mean time.

 

Anyone have any creative ideas?

 

Thanks

 

2 Replies

  • Forgot to include iRule parsing error: list element in quotes followed by x instead of space

     

  • kunjan's avatar
    kunjan
    Icon for Nimbostratus rankNimbostratus

    Try this before the HTTP::cookie

    HTTP::header replace cookie [string map {" " ""} [HTTP::header cookie]]