• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session referrance  RSS feed

 
Manoj John
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
please help me..
Is there any way to get the reference of another session?
 
Richard Bradford
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ive not tried this but the following may work.

On each request get the session for the current user.
Check if this is a new session by looking for some attribute.
If it is a new session then add to a list which is a member variable of your servlet otherwise ignore it.
You can then use this list to access all the current sessions.
I guess you will have to remember to remove sessions that have expired from the list as well.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look into the various session "listener" interfaces for various ways to keep track of sessions. See the javax.servlet.http JavaDocs.
Bill
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36446
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manoj,
Also, note that the session needs to be in the same web application.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!