Login question...

G

gbattine

Hi guys,
i've a question for you.
I'm developing a jsf application and i've a question about login.
I want securing my applicatio,tha is if a user enters with one username
and password,during its navigation,another user can't enter with same
data.
My first solution has been setting one loggedIn property in my user
table to 1 when user enters application.
If another user try to enter with same data,loggedIn=1 stops it.
When one user logout,loggedIn became=0.
It works fine until user enter and leave out correctly.
How can i do if user close browser without logout?
Can you help me improving my solution or giving me another one?
Thanks very much
 
M

Moiristo

gbattine said:
Hi guys,
i've a question for you.
I'm developing a jsf application and i've a question about login.
I want securing my applicatio,tha is if a user enters with one username
and password,during its navigation,another user can't enter with same
data.
My first solution has been setting one loggedIn property in my user
table to 1 when user enters application.
If another user try to enter with same data,loggedIn=1 stops it.
When one user logout,loggedIn became=0.
It works fine until user enter and leave out correctly.
How can i do if user close browser without logout?
Can you help me improving my solution or giving me another one?
Thanks very much

I would suggest that you use a session listener to reset the flag when a
session is destroyed. You can declare one in the web.xml like this:

<listener>
<listener-class>myproject.util.SessionListener</listener-class>
</listener>

This is only an idea, I have never used it and therefore I can't give
you any sample code. However, there should be enough information
available on the web.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top