Data360 Analyze

 View Only
  • 1.  Setting cookies in a HTTP node

    Employee
    Posted 01-09-2019 10:00

    Hi - am looking for some advice around processing and setting cookie headers in a request.

     

    I receive back a cookie field as per below:

     

    Cookie-Origin: WHATEVER.URL.COM|443|true
    Set-Cookie: tr_session=a9c5ac94-8ac0-4bbc-ac0f-69fd4ec040fe; secure; httponly

     

    My node is failing due to not setting a cookie i think (as the request works in postman). So I planned to set the following:

     

    Set-Cookie= {{^CookiesOutputField^}}

     

    It fails with the below:

     

     

    The input index '0' specified as the default index does not exist. There are only 0 inputs.

    Error code: brain.node.evaluation.property.fieldResolutionError
    Raised on 2019-01-09 at 16:57:44

    Java details:
    com.lavastorm.brain.node.http.HttpNodeNew
    (HttpNodeNew.java@416)

     

    I have also tried to hardcode the cookie into the request but get the following:

     

    Unexpected exception in processing.

    Error code: 
    Raised on 2019-01-09 at 16:59:24

    Java details:
    com.lavastorm.brain.node.http.HttpNodeNew
    (HttpNodeNew.java@502)

     

    any help appreciated

     

    thanks

     

    Martin

     



  • 2.  RE: Setting cookies in a HTTP node

    Employee
    Posted 01-10-2019 08:03

    It is likely that you could work with the headers the way you have been trying to, but it's easier to use the built in feature(s) for working with Cookies.

    In the first HTTP node, you won't have cookies coming in, so you can leave the "Cookies" field blank.
    You will then pick "Response" for the CookieAccumulation (only retain cookies from the response)
    And any field name you wish for the CookiesOutputField.

    Then, in the second HTTP node, you select "Cookies(FromField)" and give it the field name you selected above.

    It's your choice whether to then only do CookieAccumulation for "All" (merge the first and second sets of cookies) or just "Response" (only use the cookies from the second http node - don't merge them together)

    Then, you can again decide to output the cookies to a field from the second HTTP node. I've found it's easier to rename the field each time as you go from node to node, because the node doesn't like overlaying the same field name from input to output (unless you work with the PassThroughFields parameter)

     



  • 3.  RE: Setting cookies in a HTTP node

    Employee
    Posted 01-10-2019 09:35

    Thanks Stony - all sorted now. 

     

    Cheers

     

    Martin