# Can I use runtime.RUNTIME\_CTX\_VARS to pass value to server?

**URL:** <https://forum.heroiclabs.com/t/can-i-use-runtime-runtime-ctx-vars-to-pass-value-to-server/409>\
**Category:** Local Setup\
**Created:** [December 23, 2019, 4:06am UTC](https://forum.heroiclabs.com/t/can-i-use-runtime-runtime-ctx-vars-to-pass-value-to-server/409 "2019-12-23T04:06:20Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![gupta-vaibhav](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/gupta-vaibhav/32/146_2.png) [@gupta-vaibhav](https://forum.heroiclabs.com/u/gupta-vaibhav)\
**Post date:** [February 12, 2020, 12:04pm UTC](https://forum.heroiclabs.com/t/can-i-use-runtime-runtime-ctx-vars-to-pass-value-to-server/409/6 "2020-02-12T12:04:52Z")

</div>

@novabyte at server startup? or did you mean session startup, just to be sure.

The concern that I had was that in the before hook, the session hasn’t yet been authenticated. I don’t even have the user id at that point (although I can get it based on the custom\_id, but that would be an additional db query just to set the session vars).

So technically setting session variables even before the session has been created didn’t feel right to me personally. Ideally, I would have created them in the after hook.

Besides, other session vars such as ‘paid user’, could change mid session. For most practical cases, we could wait until the next session for the var to be updated, but the right implementation would be to set it right away.

---

_[View the full topic](https://forum.heroiclabs.com/t/can-i-use-runtime-runtime-ctx-vars-to-pass-value-to-server/409)._
