Skip to main content
1-Visitor
November 29, 2018
Question

Set session cookie in Thingworx Services

  • November 29, 2018
  • 1 reply
  • 2587 views

Hi Developers,

 

When i login to the mashup through browser the JSESSIONID is set to all the thingworx services called during that session. Is there a way to add or set another cookie to those services?

 

I have checked the "Content Loader Function" resource and it only has "Get Cookies" service and nothing else for my use case.

 

Regards,

Saran

 

1 reply

22-Sapphire I
November 29, 2018

My guess is you want to set the cookie in the user browser.

However the Thingworx server (and the collection functions) is server side not client side.

So to manipulate the cookie, you might be able to do it with the Expression widget, else some custom widget (basically one that functions like a client side 'extension' to the mashup capabilities)

I don't think the Expression widget supports the 'document' object through.

1-Visitor
November 30, 2018

Hi @PaiChung,

 

Thanks for your reply.

 

I have used expression widget to manipulate services but not the browser cookies. Could you please elaborate how to use expression widget for our use case?

 

Regards,

Saran

22-Sapphire I
November 30, 2018

Again I think the Expression widget doesn't allow you to use the 'document' object

But otherwise here is a reference: https://www.w3schools.com/js/js_cookies.asp