Can I use runtime.RUNTIME_CTX_VARS to pass value to server?

@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.