Just be careful with getting a reference to the managed bean from the session map directly. It might not be there yet. Managed Bean has a lazy initialization. It means the session scope managed bean is initialized and put in the session bean not at the moment the session is created, but when the managed bean is first time referenced.
This following code returns the reference to the managed bean and create it if it is not in the session map yet: