I'm required to restrict a user from signing into the same URL second time.
i.e., when a user A has logged in to the application with user name "A",he can not log in with other user name with in the same browser.
I had an idea like, on load of the login page i will check for the session, if the session is null direct to the login page else, to the home page.
But how will i be able to check the session in login page?
i fear if you got my question wrong.
I was trying to say that given a client only one user can login to the application with in the same browser.If he visits the same URL in a new tab or new window of the same browser he should be directed to home page directly need not login again,i.e.,He will not be able to view login page again so their is no chance for him to log in with a different user name.
Consider you are using session in your code, then whenever a new window opened that would have new session... so you can solve a part of the problem by this....
when going for a new tab try the same.... session and cookie combined will give you a answer...
reply how it works....
Joined: Jun 10, 2005
Sorry to say but if you a open a new window from an existing window it will still be in the same session, same thing goes when you open another tab.
I think the solution resides in setting in the session an array or a list of any type containing all the visited URLs by the user.
At the beginning of each page that is called you should check if this url was visited or not, if not let him do whatever he wants otherwise force redirection to the home page.
Remember that a session ID will remain the same as long you did not log out or session did not expire and you are in the same browser not matter how many tabs you open or how many windows you open.