Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Active Session  RSS feed

 
Malhar Me
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am implementing the functionality to count the no. of active users, which are currently loggedin to the system.
I am using HttpSessionListener interface to track the session count, bu the problem is that even if the user is just see the index page (welcome page)the session is created.
I want that, only if user will login then session will create. How can I do that?
 
Manish Singh
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One place to do it would be the URLs which are performing the login and logout.
 
Manish Singh
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you also need to track the timeout sessions without user logout
 
Malhar Me
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Manish,

Thanks for the reply.
session time out is another scenario. (Thanks for pointing it out)
but how can I track that thing. thats the only problem I have. Using listeners, it cerate the session before successful login.
and I dont understand how can I implement it.
 
Manish Singh
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At logi url...
when you verifies the user name and password and you say that the user is longed in Increment the counter.
At logout URL when you invalidate the session decrement the counter.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!