Why Vuju Design

The widest range of services offered by Vuju Design is cheap website design, web development, web hosting, logo design, joomla cms, graphic design, search engine optimization and promotion and a lot more solutions under one roof. We offer our clients a full spectrum of professional yet affordable web development and website design aiming at powerful and effective presentation at the World Wide Web.

Joomla

Outsourcing Website Design Solutions

Outsourcing Website Design Solutions
If you are a web development company, web design agency or small business web design firm, and want to outsource your web site design looking for web design company in Nepal, then you are at right place.... More

Free Web Design Quote

« Solution to resolve FCK editor loading problem for all browsers   |   Codeigniter problem in Godaddy hosting »

How to resolve multiple login problem from the same account ID using php ?

User Login and Authentication is one of the crucial issues to be addressed during the web application development. In order to address the security issues, a new practice for restriction on the multiple login with the same account ID has been developed. To implement this security tips, there are various standards developed. This article will help you to explore the various methods developed to restrict the multiple user login with the same account through PHP.

To resolve these issues you may define a field in database to record the flag that helps to track whether the user has been logged in or not. You can set the flag to be 1, if the user is logged in and flag as 0 if the user is not logged in. This operation is to be performed when the user is authenticated so that the application can restrict the multiple accesses with the help of the flag recorded.  While writing the authentication function, check the flag at user authentication table on the basis of the stated username and restrict the user if the flag is set to 1. When the user logs out, do not forget to set this flag to 0.

This solution seems to work  fine if the user clicks the logout button. But sometimes there may arise a situation where the user forgets to click the logout button, rather closes the browser window. This indeed will set the flag always to be 1 as a result the account is restricted to log in. One of the common  solution posted in most of the forum, to resolve this issues, is to use the JavaScript function to detect whether the window is closed and call the Ajax function to set the flag to 1. This solution cannot resolve problem in all of the browsers because the JavaScript method to detect the windows activity such as opened or closed, is not compatible to all of the browser. Hence I wont recommend this solution.

Most Secure and reliable solution would be, to handle this issues through the session. During  the time of authentication, record the session and the user ID that is established when  the user is logged in using the session table. When the user is logged out delete this session from the table. To restrict the multiple access check whether the session table contains the entry for the desired username during the time of login. If the username already exist in the database, delete the old session from the database, start the new session and record the new session id that is established during the new login. You can prompt the user that you have been logged out from the previous environment.  This will log the user in but logs out if he / she has been logged in at any other system because the old session has been deleted from the database.

This entry was posted on Saturday, July 12th, 2008 at 10:47 am and is filed under Solution. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 Responses to “How to resolve multiple login problem from the same account ID using php ?”

  1. JORGE Says:


    Pillspot.org. Canadian Health&Care.Best quality drugs.Special Internet Prices.No prescription online pharmacy. High quality pills. Order pills online

    Buy:Arimidex.Accutane.Actos.100% Pure Okinawan Coral Calcium.Petcam (Metacam) Oral Suspension.Lumigan.Zyban.Human Growth Hormone.Nexium.Prevacid.Retin-A.Prednisolone.Valtrex.Mega Hoodia.Synthroid.Zovirax….

  2. RENE Says:


    Medicamentspot.com. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.Best quality drugs. High quality drugs. Buy drugs online

    Buy:Valtrex.Retin-A.Mega Hoodia.Zovirax.Actos.Synthroid.Prednisolone.Zyban.Lumigan.Accutane.Prevacid.Petcam (Metacam) Oral Suspension.100% Pure Okinawan Coral Calcium.Arimidex.Human Growth Hormone.Nexium….



Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word