# Setting session custom variables with a gateway startup script

**URL:** <https://forum.inductiveautomation.com/t/setting-session-custom-variables-with-a-gateway-startup-script/30443>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 4, 2019, 5:31pm UTC](https://forum.inductiveautomation.com/t/setting-session-custom-variables-with-a-gateway-startup-script/30443 "2019-12-04T17:31:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tyrel.parker](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@tyrel.parker](https://forum.inductiveautomation.com/u/tyrel.parker)\
**Post date:** [December 4, 2019, 5:31pm UTC](https://forum.inductiveautomation.com/t/setting-session-custom-variables-with-a-gateway-startup-script/30443/1 "2019-12-04T17:31:34Z")

</div>

I have a perspective project that I want to set some of the custom variables on startup so that I don’t have to make sure that I clear them after each design session. I can’t figure out how to target those variables from a startup script though. I was trying self.session.custom.foo with no luck.

Anyone else know how to do this? Or is there a setting somewhere that sets all session custom variables to null at startup. That would work for me as well.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 4, 2019, 5:41pm UTC](https://forum.inductiveautomation.com/t/setting-session-custom-variables-with-a-gateway-startup-script/30443/2 "2019-12-04T17:41:23Z")

</div>

Are you trying to use a _gateway_ startup script, or a _session_ startup script? You should be able to modify your session props from a session startup script just fine; just access the `session` parameter:  
[https://docs.inductiveautomation.com/display/DOC80/Perspective+Session+Event+Scripts#PerspectiveSessionEventScripts-Startup/ShutdownEventScripts](https://docs.inductiveautomation.com/display/DOC80/Perspective+Session+Event+Scripts#PerspectiveSessionEventScripts-Startup/ShutdownEventScripts)

---

<div class="post-metadata">

**Author:** ![tyrel.parker](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@tyrel.parker](https://forum.inductiveautomation.com/u/tyrel.parker)\
**Post date:** [December 4, 2019, 6:05pm UTC](https://forum.inductiveautomation.com/t/setting-session-custom-variables-with-a-gateway-startup-script/30443/3 "2019-12-04T18:05:26Z")

</div>

I was trying to use gateway startup events. I had forgotten about the session events.
