cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Set session cookie in Thingworx Services

SaranKarthick
16-Pearl

Set session cookie in Thingworx Services

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

 

3 REPLIES 3

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.

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

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

 

Top Tags