File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I "force create" a new session in JSF

 
Walter Chen
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, group:

In our system we use JSF, we have a log-in page and want to always create a new HTTP session when the user accesses this page. The reason is sometimes users do not always log out of their previous session and they try to log in again (could be a different user), but the session data will still remain there.

Is there a header or something in the JSF code that we can use to force create a new session?

Thanks,
Walter
 
Andres Quinones
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Walter Chen:
Hi, group:

In our system we use JSF, we have a log-in page and want to always create a new HTTP session when the user accesses this page. The reason is sometimes users do not always log out of their previous session and they try to log in again (could be a different user), but the session data will still remain there.

Is there a header or something in the JSF code that we can use to force create a new session?

Thanks,
Walter


Walter what you can do is add this code to the method where you do the authentication of the user
HttpSession ses = ( HttpSession ) FacesContext.getCurrentInstance().getExternalContext().getSession( true );

I hope this helps
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic