# Old context variables are still accessable after deploy

**URL:** <https://discourse.nodered.org/t/old-context-variables-are-still-accessable-after-deploy/23839>\
**Category:** General\
**Created:** [29 March 2020 16:21 UTC](https://discourse.nodered.org/t/old-context-variables-are-still-accessable-after-deploy/23839 "2020-03-29T16:21:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![r0ller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/r0ller/32/14327_2.png) [@r0ller](https://discourse.nodered.org/u/r0ller)\
**Post date:** [29 March 2020 16:21 UTC](https://discourse.nodered.org/t/old-context-variables-are-still-accessable-after-deploy/23839/1 "2020-03-29T16:21:58Z")

</div>

Hi All,

I've just noticed that if I rename a context variable in a function say:

flow.set("a",1);

to:

flow.set("b",1);

the old context variable "a" still lingers there after deploy (node-red 1.0.2). At least, flow.keys() lists both.

Isn't it possible to get rid of "a" during deploy?

Best regards,  
r0ller

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [29 March 2020 16:28 UTC](https://discourse.nodered.org/t/old-context-variables-are-still-accessable-after-deploy/23839/2 "2020-03-29T16:28:13Z")

</div>

No. Context does not get cleared as part of a deploy. If you want to remove something from context you must set it to `undefined`.

---

<div class="post-metadata">

**Author:** ![r0ller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/r0ller/32/14327_2.png) [@r0ller](https://discourse.nodered.org/u/r0ller)\
**Post date:** [29 March 2020 16:30 UTC](https://discourse.nodered.org/t/old-context-variables-are-still-accessable-after-deploy/23839/3 "2020-03-29T16:30:18Z")

</div>

Ok, thanks! Will need to keep an eye on it or restart node-red 🙂

---

<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:** [28 May 2020 16:30 UTC](https://discourse.nodered.org/t/old-context-variables-are-still-accessable-after-deploy/23839/4 "2020-05-28T16:30:25Z")

</div>

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