Calling a setter via craft.app in Twig
I'm curious to know your use case for this, but have you tried using Twig's do tag?
https://twig.symfony.com/doc/2.x/tags/do.html
i.e. {% do craft.app.session.set(&quot;mySession&quot;, &quot;someValue&quot;) %}