<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Session Timeout Warning Dialog in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028834#M70296</link>
    <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/397183"&gt;@pshashipreetham&lt;/a&gt;&lt;/SPAN&gt; ,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I wanted to follow up with you on your &lt;A href="https://community.ptc.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028151#M70245" target="_blank"&gt;post &lt;/A&gt;to see if your question has been answered.&lt;BR /&gt;If so, please &lt;STRONG&gt;mark the appropriate reply as the Accepted Solution&lt;/STRONG&gt; for the benefit of other members who may have the same question.&lt;BR /&gt;Of course, if you have more to share on your issue, please let the Community know so that we can continue to support.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Abhi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="width:45.56%;" src="https://lithium-response-prod.s3.us-west-2.amazonaws.com/ptc.response.lithium.com/RESPONSEIMAGE/7d9f6428-180d-4ffc-a74e-5b2054f46aeb.default.png" /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Aug 2025 18:38:53 GMT</pubDate>
    <dc:creator>abandal</dc:creator>
    <dc:date>2025-08-11T18:38:53Z</dc:date>
    <item>
      <title>Session Timeout Warning Dialog</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028151#M70245</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="280" data-end="495"&gt;I’m working on a ThingWorx application where users stay on the dashboard for extended periods. I want to implement a &lt;STRONG data-start="397" data-end="429"&gt;session idle timeout warning&lt;/STRONG&gt; – similar to how most enterprise web apps display a popup like:&lt;/P&gt;
&lt;BLOCKQUOTE data-start="497" data-end="573"&gt;
&lt;P data-start="499" data-end="573"&gt;“You've been idle for 20 minutes. Do you want to continue your session?”&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P data-start="575" data-end="689"&gt;&lt;BR /&gt;If the user doesn't respond within the countdown period, the session should expire or redirect to a logout page.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P data-start="691" data-end="784"&gt;Has anyone implemented this kind of &lt;STRONG data-start="727" data-end="759"&gt;“Are you still there?” &lt;/STRONG&gt;modal in a ThingWorx Mashup?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 20:21:06 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028151#M70245</guid>
      <dc:creator>pshashipreetham</dc:creator>
      <dc:date>2025-08-06T20:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Session Timeout Warning Dialog</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028202#M70250</link>
      <description>&lt;P&gt;Hello Shashi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The conceptual issue with this approach is what happens if you open this app in tab #1 and then in 5 minutes in tab #2 -- what will the user see? You don't want to force-expire their session after 20 minutes from tab #1, because in tab #2 only 15 minutes elapsed, and the user might be using the app from that tab #2, while keeping tab #1 open for whatever reasons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, even if you implement a countdown in your mashup, you'll never know if your user session was extended from another browser tab, or automatically by running some internal service that you don't control, e.g.&amp;nbsp;GetAllStyleDefinitions. In practice it means that you will often think that the session is about to expire, while in reality it has been refreshed just a minute ago.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's no way to get the remaining session duration, only to extend the session. You can implement a Java extension that would get this information from Tomcat, but calling this extension through a service would automatically renew your session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only mechanism I was able to implement reliably was to detect that the session has already expired, and then block the user via a modal popup with some explanation and a "Re-login" button. To function correctly this requires a pair of extensions -- a custom Authenticator on the backend side plus a UI extension to fire an event when it encounters an HTTP 403.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: On the second thought, you &lt;EM&gt;might be able&lt;/EM&gt; to write a UI extension that would &lt;A href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Intercept_HTTP_requests" target="_self"&gt;intercept all HTTP calls&lt;/A&gt; to ThingWorx and update some "last session refresh" timestamp shared between different browser windows and tabs via "window" DOM objects. Then, in theory, you should be able to infer the end of session somewhat reliably. I've never seen this done in real life, not only for ThingWorx.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/ Constantine&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 07:20:47 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028202#M70250</guid>
      <dc:creator>Constantine</dc:creator>
      <dc:date>2025-08-07T07:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Session Timeout Warning Dialog</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028209#M70253</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I never did it but I think that we have everything needed on server side :&lt;/P&gt;&lt;P&gt;- Monitoring -&amp;gt; Connected Users: You have the time since last connection which is refreshed each time user is calling server. So you should find an API on server side to get this information programmatically.&lt;/P&gt;&lt;P&gt;- &lt;SPAN&gt;UserManagementSubsystem -&amp;gt;&amp;nbsp;Idle Session Timeout (min) that indicates you&amp;nbsp; the session time (if you want to say only 10 minutes remaining)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Each minute you can run a scheduler / timer to check all users that are connected since x minutes (or Y minutes reamining before session closure). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tricky point is to pass the information to the client side in order to have a popup : maybe you can create a user thing which is linked 1 to 1 to the user. With this thing, you will be able to use WebSocket to pass the information in live to client side. Then on your master it will be easy to compute information and to display a pop-up. It sounds feasible but never tested !&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Other point : does it deserve to open a Web Socket for each user (or even each tab of user) only for this purpose ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Guillaume&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 08:15:46 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028209#M70253</guid>
      <dc:creator>GuillaumeL</dc:creator>
      <dc:date>2025-08-07T08:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Session Timeout Warning Dialog</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028214#M70254</link>
      <description>&lt;P&gt;Creating a user Thing won't be sufficient, as they might login from two different devices at the same time. You'd really need to have a "session" thing, which would have very dynamic lifecycle, as those sessions expire -- an &lt;EM&gt;usine à gaz&lt;/EM&gt;, basically.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 08:40:32 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028214#M70254</guid>
      <dc:creator>Constantine</dc:creator>
      <dc:date>2025-08-07T08:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Session Timeout Warning Dialog</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028222#M70257</link>
      <description>&lt;P&gt;My solution would work only for people connected from a single device. That can help in some use cases.&lt;/P&gt;&lt;P&gt;And to be sure to be connected from a single device you can activate this option "&lt;SPAN&gt;Restrict the number of concurrent logged in user sessions" in&amp;nbsp;UserManagementSubsystem.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 09:01:25 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028222#M70257</guid>
      <dc:creator>GuillaumeL</dc:creator>
      <dc:date>2025-08-07T09:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Session Timeout Warning Dialog</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028223#M70258</link>
      <description>&lt;P&gt;Just my 2 cents.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If somebody seriously asked me to implement something like that, I'd probably do it as a standalone webapp, which would query Tomcat sessions via JMX. It would expose the expiration timestamp via an HTTP endpoint that would take a JSESSIONID as a query parameter. I've just checked -- Tomcat's MBean does expose session IDs (so that we can "authenticate" those API calls) and expiration, so this is doable.&amp;nbsp;I would then deploy it on the same Tomcat, just to avoid operational overhead. I'd call this API from my mashups through a tiny UI extension that would take JSESSIONID from a cookie.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sounds like one fun day of work.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 09:05:09 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028223#M70258</guid>
      <dc:creator>Constantine</dc:creator>
      <dc:date>2025-08-07T09:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Session Timeout Warning Dialog</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028447#M70269</link>
      <description>&lt;P&gt;Question is how reliable you need this to be. As&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/304626"&gt;@Constantine&lt;/a&gt;&amp;nbsp;pointed out this can be arbitrarily complex.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just go for the 80% solution, you could find out about the idleness by linking every click event on a widget to a service call, writing a timestamp into the Session object (serverside) or with an expression into clientside session object(&lt;SPAN class="codeph codephbreak"&gt;TW.&lt;SPAN class="Search_Result_Highlight"&gt;sessionStora&lt;/SPAN&gt;ge&lt;/SPAN&gt;), but that is hardly manageable, especially with complex mashups.&lt;/P&gt;
&lt;P&gt;Note that in TWX 10 there is a new Timer widget you could use for a countdown, but it won't solve the underlying issues sketched before, like multiple tabs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2025 08:31:29 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028447#M70269</guid>
      <dc:creator>Rocko</dc:creator>
      <dc:date>2025-08-08T08:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Session Timeout Warning Dialog</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028454#M70270</link>
      <description>&lt;P&gt;Oh man, I forgot about&amp;nbsp;&lt;SPAN class="codeph codephbreak"&gt;TW.&lt;SPAN class="Search_Result_Highlight"&gt;sessionStora&lt;/SPAN&gt;ge&lt;/SPAN&gt;! Thanks for bringing it up, this will help me solve an issue on another project right now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/ Constantine&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2025 08:57:45 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028454#M70270</guid>
      <dc:creator>Constantine</dc:creator>
      <dc:date>2025-08-08T08:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Session Timeout Warning Dialog</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028834#M70296</link>
      <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/397183"&gt;@pshashipreetham&lt;/a&gt;&lt;/SPAN&gt; ,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I wanted to follow up with you on your &lt;A href="https://community.ptc.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028151#M70245" target="_blank"&gt;post &lt;/A&gt;to see if your question has been answered.&lt;BR /&gt;If so, please &lt;STRONG&gt;mark the appropriate reply as the Accepted Solution&lt;/STRONG&gt; for the benefit of other members who may have the same question.&lt;BR /&gt;Of course, if you have more to share on your issue, please let the Community know so that we can continue to support.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Abhi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="width:45.56%;" src="https://lithium-response-prod.s3.us-west-2.amazonaws.com/ptc.response.lithium.com/RESPONSEIMAGE/7d9f6428-180d-4ffc-a74e-5b2054f46aeb.default.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Aug 2025 18:38:53 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028834#M70296</guid>
      <dc:creator>abandal</dc:creator>
      <dc:date>2025-08-11T18:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Session Timeout Warning Dialog</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1030892#M70402</link>
      <description>&lt;P&gt;Hello &lt;SPAN style="color:var(--ck-color-mention-text);"&gt;&lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/397183"&gt;@pshashipreetham&lt;/a&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope you are doing well!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you have a chance to review the responses/suggestions provided on your &lt;A href="https://community.ptc.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1028454" target="_blank"&gt;post&lt;/A&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if you have any further questions/concerns, please let the Community know so that we can continue to support.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Abhi&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 13:38:30 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Session-Timeout-Warning-Dialog/m-p/1030892#M70402</guid>
      <dc:creator>abandal</dc:creator>
      <dc:date>2025-08-25T13:38:30Z</dc:date>
    </item>
  </channel>
</rss>

