Topic
No replies
joe_jess
joe_jess
80 Posts
ACCEPTED ANSWER

Pinned topic Session Mixed Up

‏2012-11-27T14:10:38Z |
I have this intermittent problems where one user is seeing and using another userid.

After login, I set his userid and name to the session attribute

FacesContext context = FacesContext.getCurrentInstance();
context.getExternalContext().getSessionMap().put("user_id", "value retrieved from db");

Where required, I would retrieve back the userid using the following method

FacesContext context = FacesContext.getCurrentInstance();
Object o = (Object) context.getExternalContext().getSessionMap().get("user_id");

Is there a way to solve this mix up with another implementation?