When I need something like what you're asking for I do that by setting the corresponding property in the bean manually. Pseudo code for the managed bean:
and before using the session you actually have to set it from your
JSP page:
MyBean mb = (MyBean) session.getAttribute( "MyBean" );
mb.setSession( session );
Same applies to other stuff.