You would have to use a Java scriptlet or custom tag to retrieve the value from the session and assign it to a Javascript variable or form input value.
<script type=”text/javascript”>
var sessionId = <%= session.getId() %>
</script>
Of course you’d use session.getAttribute(“varname”) to get your object (not “variable”) from the session and you’d have to deal with casting it to its type and getting the value of the specific member you’re looking for.