But depending on what you want, you might be able to workaround it. A simple method I would think of is, use AJAX to call a server-side method to fetch the value you want from the session. But please, keep it in mind that this is NOT RECOMMENDED. A method that you can call, anyone else can call
Unless, you authenticate the access.
Hope this helps.