Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session validation/invalidation

 
Bloo Barton
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I cause a forced session invalidation for timeouts, manual logouts and such when using struts?

How can I check that a session is still valid and the user is still logged in using struts?
 
Ryan Dillon
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bloo,

You can invalidate the session using:

(Note that this is a standard J2EE function, not specific to Struts)


If a session is still valid, then calling:


will return a non-null session. However I have a feeling Struts will automatically create the session (if it does not exist) before any Action is called. You may need to create a custom RequestProcessor or ServletRequestListener to intercept the call before this happens.

Hope that helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic