Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invalidate session

 
Dhara Bhatt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on web application using struts, JSP technology. Anybody can help on the following?

1. In my web application, I have logout button. When user will click on logout button, session is going to be invalidated. Related that, I have one field by name 'SITACD' into Database.
2. Default value of 'SITACD' field is '0'.
3. When user will login into application, I am making that field's value 'SITACD=1' to keep track, whether user has been logged in or not.

4. If ohther user will try to login by same id, then firt I m checking, whether 'SITACD' value is 1, if it's 1, then should not allow to login by same id.

5. When user will click on 'logout' button, this field's value will become '0' again.

Problem : If user will dierectely close browser, session will be automatically expired. But how to set this field 'SITACD' 's value to '0'.

How to identify, if session is expired by closing the window directely.

If anybody can help me in this, it would be very helpful to me.

Dhara.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Closing the window does not expire the session, so you can't detect that.

With a session listener you can determine when the orphaned session times out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic