Forum Discussion

james_scee's avatar
11 years ago

Trying to set a cookie using http.client FreeMarker Context Object

[Mod note: This post was originally a comment posted to this TKB article: http.client FreeMarker Context Object ]

I'd like to set a cookie, I'm using 

<#assign remember_login_cookie = http.request.createCookie("MR_TINGLY", "johnD") /> 
${remember_login_cookie.setDomain(".eu.playstation-aem-qa.com")} 

Once I have set the cookie, I'd like to pass it in a request: 

<#assign http_client_request = http.client.request("http","forum.eu.playstation-aem-qa.com","/?xxx=bobo&bilko=qa_cookie").cookie(remember_login_cookie).get().content/> 
qa cookie: ${http_client_request?string!"cookie req fail"} 

The request succeeds, but the cookie is not set, would you be able to give me any pointers? 

This is inside an endpoint.

No RepliesBe the first to reply