• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to delete a session by knowing the session id

 
sitaram irrinki
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First user login in my site with

User name--Rajesh

Password---password at 10.15 am and he is doing some task in my site



After some time some another user login with

User name--Rajesh

Password---password at 10.30 am



At that time I want to remove first person's session how to I remove it (for example yahoo chat)



how to find session all session id id's at a particular time

how to delete a session by knowing the session id.
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to invalidate session.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sitaram,
Preventing multiple logins with the same user/id was discussed in great detail a month or two back on this or the JSP forum.
If you're really interested in the topic, it's worth spending some time with the search feature on this site to look that tread up.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to find session all session id id's at a particular time
how to delete a session by knowing the session id.

As I recall, the early version of the servlet API let you do this sort of thing but the methods were considered a security risk and were removed.
The simplest thing to do is to make a plain old java object (POJO) that holds a user's information and manage those separately from the HttpSession mechanism. For example, in a collection keyed by user name.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic