No, you can not do that, you can only rennder the javascript(a part of html) use the session varibale, but after it is rendered, the html is fixed! So you can not use the session variable of tempalte context.
May you can try to generate a variable in the rendered html by using your template session variable.
e.g.:
<script type="text/javascript">
var username = "$context.username";
</script>
or:
<script type="text/javascript">
var session = {
foo: "$context.foo",
bar: "$context.bar",
...
};
</script>
In your application code:
render = web.temlate.render('templaters', global={'context': session})