# In node-red how to store tcp data in session context

**URL:** <https://discourse.nodered.org/t/in-node-red-how-to-store-tcp-data-in-session-context/50818>\
**Category:** General\
**Created:** [9 September 2021 13:58 UTC](https://discourse.nodered.org/t/in-node-red-how-to-store-tcp-data-in-session-context/50818 "2021-09-09T13:58:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul123-dotcom](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rahul123-dotcom/32/46865_2.png) [@rahul123-dotcom](https://discourse.nodered.org/u/rahul123-dotcom)\
**Post date:** [9 September 2021 13:58 UTC](https://discourse.nodered.org/t/in-node-red-how-to-store-tcp-data-in-session-context/50818/1 "2021-09-09T13:58:00Z")

</div>

In node-red tcp server I am getting username for the first time for authentication. So, I need to store for the session. So, for the second packet I just want to send the data with the user name appended which is sent earlier for authentication to mqtt broker. So, how can I store the username first and send the username for next data onward in node-red tcp server. The users can be any number who is connecting and sending data .

---

<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:** [8 November 2021 13:58 UTC](https://discourse.nodered.org/t/in-node-red-how-to-store-tcp-data-in-session-context/50818/2 "2021-11-08T13:58:08Z")

</div>

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