tags:

views:

1839

answers:

1

How do I retrieve the session ID value inside a JSF managed bean?

+5  A: 
FacesContext fCtx = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession) fCtx.getExternalContext().getSession(false);
String sessionId = session.getId();
Damo
I was just about to answer with almost the exact same code :)
Yuval A