Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
can anybody tell, how to automatically remove the thingworx catche from the browser using code?
Regards
Sugumar R
Not sure if any of the available code executions would work from within a mashup using the expression widget, but you can give it a try.
Here's an article from stack overflow: https://stackoverflow.com/questions/8155064/how-to-programmatically-empty-browser-cache
Alternatively you can add/modify caching headers on the HTTP server level (e.g. Nginx), but... why?
/ Constantine
Hi Constantine,
My requirement is to clear Thingworx catch after the user logged out from the Twx.
Currently, the Thingworx catch allow the user to log in to the composer without asking the password.
kindly suggest me any solution for that.
Regards
Sugumar R
Strange. If you do it the standard way through the Logout Button mashup widget, the users should not be able to reconnect after that. For that I have to ask -- how do you log your users out? Do you use Logout Button or Logout Link widgets? Do you have any custom authenticators?
A bit more technical explanation: It's not the cache, it's the session which keeps the user logged in. The session is on the server side, so clearing the cache is not a proper solution, because you don't kill the actual session, just remove its ID from the browser. Besides, potentially you make the some mashups load slower next time, putting additional load on the server. Still, if you really want to go that way, you probably don't need to empty the entire cache, but instead you can try to only reset the cookie called "JSESSIONID". To do this you'll need to either write you custom extension, which will do it via browser-side Javascript, or configure it on the reverse proxy side (Nginx or similar). Neither of those options is trivial to implement. Besides, the standard Logout Button widget does pretty much the same thing for you, so I would advise you to look in this direction and try to understand why it doesn't work (if you use it, of course) instead of implementing complex workarounds.
/ Constantine
Thank you for your inputs, Constantine.
I am already using a Logout widget that is available in the marketplace.
when the user logout the first time means the session terminated properly. The right next time the logout button not clearing the session.
That's why I am searching for a solution.
Regards
Sugumar R
Sugumar,
What version of ThingWorx do you use? I believe that at least in 7.4 Logout Button is available out of the box, there's no more need to install it from Marketplace. Can you try with the standard widget? Also, it looks like in 8.4 we also have a Logout Link widget (I'm not sure whether it's part of the core platform or Manufacturing Apps though) -- can you try it as well?
/ Constantine
Constantine,
I am using Twx 8.3.3, I checked both the package version of the logout button (1.0.0 & 8.4).
But the problem continuing.
Regards
Sugumar R
Sugumar,
Just my two cents. I would suggest opening a Tech Support call with PTC regarding the Logout Button which doesn't work as expected. This way they will be able to resolve the issue with standard functionality and you won't have to support it yourself. The workaround for removing JSESSIONID that I mentioned requires writing extensions or setting up an external HTTP server, and even though it is not complex, but you will have to maintain those solutions.
/ Constantine