Details
-
Type: Bug
-
Status: Closed
-
Priority: Blocker
-
Resolution: Invalid
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
In my application, whenever I am logging out, I am calling the following logic:
ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
HttpSession session = (HttpSession)ectx.getSession(false);
session.invalidate();
However, the problem is that when I log back into this application, I need to have user id to retrieve some initiial information from DB. When I call FacesContext.getCurrentInstance().getExternalContext().getRemoreUser(), it returns null because the FacesContext is null. Is the way I am invalidating the seesion correct? Why I cannot access FacesContext? I have to redeploy the application in order to proceed correctly with FacesContext and getRemoteUser().
ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
HttpSession session = (HttpSession)ectx.getSession(false);
session.invalidate();
However, the problem is that when I log back into this application, I need to have user id to retrieve some initiial information from DB. When I call FacesContext.getCurrentInstance().getExternalContext().getRemoreUser(), it returns null because the FacesContext is null. Is the way I am invalidating the seesion correct? Why I cannot access FacesContext? I have to redeploy the application in order to proceed correctly with FacesContext and getRemoteUser().
Hi Chris,
I have a few questions which will help in my investigation:
Thanks,
Arran