hi, currently i'm working on new project, where once login using a particular id, it can not be use again to login in same machine even with different browser or even in other machine. how can done this. can i create a separate table in database so i can save and retrieve data od session id, creation time or last access time. can any one help me on this.

thanks

Recommended Answers

All 6 Replies

try synchronizing the session object.

try synchronizing the session object.

hi hardik, thanks for ur reply, if you don't mine, can u give me a sample on that

Yes,
you may use a table for keeping track of all the details of active sessions when one user successfully login. I think it will be also a good idea to record the login time and use a timeout.
As a session variable is not valid when user change the browser it will not be really handy to use simple session variables for your purpose.

And take care you does not LOCK OUT a user who accedentally forget to logout.

Regards,
SNIP

adatapost>I agree with nabeel. If you are able to and familiar with HttpSessionListener an its methods then you can do this thing in better way.

how to clear sessions in jsp . please provide details.

how to clear sessions in jsp . please provide details.

session.removeAttribute("key");
and
session.invalidate();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.