# Opc UA client node session disconnects with Server after few minutes

**URL:** <https://discourse.nodered.org/t/opc-ua-client-node-session-disconnects-with-server-after-few-minutes/65260>\
**Category:** General\
**Tags:** http-request\
**Created:** [18 July 2022 11:06 UTC](https://discourse.nodered.org/t/opc-ua-client-node-session-disconnects-with-server-after-few-minutes/65260 "2022-07-18T11:06:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sai](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@Sai](https://discourse.nodered.org/u/Sai)\
**Post date:** [18 July 2022 11:06 UTC](https://discourse.nodered.org/t/opc-ua-client-node-session-disconnects-with-server-after-few-minutes/65260/1 "2022-07-18T11:06:44Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/4/94d97ea77219c871a2391f373eda02481a2d574c.png)

After connecting with the server, it disconnects automatically if press deploy after few minutes. The connection is properly established.

Im trying to fetch the data from a Siemens IOT connector which is connected to the plc S7.  
The connection is lost everytime I deploy.  
The error mentioned are :

1 - Error: BadSessionIdInvalid (0x80250000)  
2 - Client disconnected & closed: connection error error: Error: BadIdentityTokenInvalid (0x80200000)

After this error i retype the credentials in OPC UA client node and deploy again it connects again.  
Im using chrome server.

Please let me know how can i fetch continuous data for over a long time without getting disconnected.  
@ [Colin] @ [knolleary] @ [dceejay] @ [TotallyInformation]

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/0/f0a2c5a9058c869085699a4e3bf37679177557ba.png)

---

<div class="post-metadata">

**Author:** ![mikakaraila](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikakaraila/32/37496_2.png) [@mikakaraila](https://discourse.nodered.org/u/mikakaraila)\
**Post date:** [18 August 2022 04:56 UTC](https://discourse.nodered.org/t/opc-ua-client-node-session-disconnects-with-server-after-few-minutes/65260/2 "2022-08-18T04:56:33Z")

</div>

Keepalive should ensure that session is not closed.  
Another way is to use some "dummy" variable that is updated as watchdog with interval that is smaller than timeout. This will keep session active & alive.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [17 October 2022 04:57 UTC](https://discourse.nodered.org/t/opc-ua-client-node-session-disconnects-with-server-after-few-minutes/65260/3 "2022-10-17T04:57:06Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
