# Auto logout implementation in Node-red dashboard

**URL:** <https://discourse.nodered.org/t/auto-logout-implementation-in-node-red-dashboard/91224>\
**Category:** Dashboard\
**Tags:** node-red-dashboard, dashboard-2\
**Created:** [24 September 2024 08:36 UTC](https://discourse.nodered.org/t/auto-logout-implementation-in-node-red-dashboard/91224 "2024-09-24T08:36:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubhamnodered](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@shubhamnodered](https://discourse.nodered.org/u/shubhamnodered)\
**Post date:** [24 September 2024 08:36 UTC](https://discourse.nodered.org/t/auto-logout-implementation-in-node-red-dashboard/91224/1 "2024-09-24T08:36:18Z")

</div>

Hi guys and hello node-red team,

Is it possible to implement **auto-logout** after 2 minutes of inactivity in node-red dashboard using **settings.js** file?

I looked online but found no information. Though someone mentioned to use custom javascript function. But my programming expertise does not lie with it....

Looking forward for the suggestion

Regards,  
Shubham

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [24 September 2024 08:47 UTC](https://discourse.nodered.org/t/auto-logout-implementation-in-node-red-dashboard/91224/2 "2024-09-24T08:47:12Z")

</div>

Hi @shubhamnodered

I don't believe there is. I know this is a difficulty @knolleary has faced too within our FlowFuse work, not sure we found a solution?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [24 September 2024 11:15 UTC](https://discourse.nodered.org/t/auto-logout-implementation-in-node-red-dashboard/91224/3 "2024-09-24T11:15:56Z")

</div>

Likely to be tied into the fact that D2 is primarily using [Socket.IO](http://Socket.IO) for comms between clients and Node-RED. UIBUILDER has the same issue.

Because [Socket.IO](http://Socket.IO) mainly relies on websockets, you don't get to use custom headers and so having a robust session management process is a hard ask.

In addition, you need to work out what "inactivity" means in these cases? What if a user is simply reading information on-screen? How often is a user _likely_ to actually interact with your web page?

You also need to implement user management on the server (less of a problem for FlowFuse possibly) that includes session management. Generally this involves using a cookie and/or a JWT. You also have to deal with whether you want sessions to auto-extend (which you normally do up to a given point).

This is why session management is often best done outside of a microservice like Node-RED, is indeed I think it is for FlowFuse users. But again, that service needs to deal with the fact that updates are mostly not happening over HTTPS but over WSS and so any token data may need to be embedded into the messages being passed in both directions.

---

<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:** [24 October 2024 11:16 UTC](https://discourse.nodered.org/t/auto-logout-implementation-in-node-red-dashboard/91224/4 "2024-10-24T11:16:18Z")

</div>

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