OpcUA server Session timeout

Hi all,
This is my first time posting here and im just wishing to share my knowledge so some one else dosent have to go throught the pain i have.
I have been working on a opcUA server for some time now, developing a server for a client to extract production data from our machine's. The problem is that they are using a "Pure python Client" (freeopcua.github.io:client) and every time it connects to my server is leaves a zombie session behind. The server is set up for 10 simultaneous connections and their client connects every 3 min. After 30 minutes the server is maxed out and then refuses any new connections. This then sends the client in to a reconnect storm, my little opcua server then thinks its in the middle of ddos storm and restarts clearing the buffer and the whole process starts again.
The client is unwilling to rewrite their opcUA client as they say it works fine for their other servers.(typicly Kepware)
I have spent weeks thinking that maybe it was due to the opcUA server i was using was old , so i upgraded node.js,npm and nodered then using @vitormnm/node-red-simple-opcua which uses the lates version of node-opc. Still no joy. Did lots of googling and ai asking but still no joy. It was only when i happend to be looking at the code of the node-opcua-server in node_modules that i found the solution.
Line 78 of node-opcua-server/dist/opcua_server.js:-

'const maxSessionTimeout = 1000 * 60 * 50; // 50 minutes'

Changed to:-

'const maxSessionTimeout = 1000 * 60 * 5; // 5 minutes'

All my problems went away, after 5 min the zombie connections were killed and the session limit was never reached. This worked on the older versions of opcua server that i was working with aswell. (node-red-contrib-opcua-server)

Thanks for sharing your use case! It's nice to see you're using node simple-opcua.

I'll add support for configuring the OPC UA session timeout in the server node in the next release.

Thats fantastic @vitormnm.