Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Loko
Creator II
Creator II

Manage cookie between 2 http requests

Hi

 

In a ESB route I'm using cHttp POST to connect to a https server. Then my 2nd request is to post data to that server. I added the certificate in my JVM , it works in a tool like Postman or Insomnia but not in my route because I guess the session cookie we get after the first call is not included in the 2nd one, than I get a 401 forbidden error. 

What is the solution to keep cookie from first to second https requests ? 

 

Loko

Labels (2)
2 Replies
Anonymous
Not applicable

Hi,

 

    Could you please try to call a DI job as shown in below scenario?

 

https://help.talend.com/reader/wPJh3yAxz0baR8imIwmlYA/X1kCQaKtALDIocZ0p6QjpA

 

A sample scenario about handling cookies can be referred from below link.

 

https://help.talend.com/reader/wDRBNUuxk629sNcI0dNYaA/1VRELvm1ibYLFfM5pqaHZg

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

Loko
Creator II
Creator II
Author

Hi

We don't want to use jobs. We work with route, and Talend itself says calling a job via cJob is not a good solution because of performance issues.

I tried this code just at the moment ans it works (send back the "Set-Cookie" camel header as "cookie", substring to remove the brackets) 

String cookieString = exchange.getIn().getHeader("Set-Cookie", String.class);
exchange.getIn().setHeader("Cookie", cookieString.substring(1,  cookieString.length()-2) );

But I wonder if there is any built-in and more robust solution. I believe the route itself should automatically manage cookies by default , as Camel does.