hackedminds
12-07-2005, 08:00 AM
Hi,
I am making a website that will have users logging on and logging off. In my database, there is a table called 'User' and I have a filed in it called 'LoginFlag' which can have a value of 'out' or 'in'. This field is designed to prevent two users logging on under the same username and to display a list of who else is logged on to the website.
In an ideal world, people would click a log off button before they exit the browser, but as its not ideal, is there any way of triggering a database update when the browser is closed? The global.asa concept would not be ideal I don't think due to the 20minute timeout as people will be using the system frequently and may log on more than once in 20 minutes. Therefore the 'LoginFlag' field in the 'User' table would still say 'in' and thus prevent a log on under that username.
Is there any way I could do this?
Perhaps the 'LoginFlag' field isn't the proper way to do this and someone might have a better concept. I really need something that will let me run a piece of code to update the database when the user closes the browser (or leaves the site, but this may be tricky as there are multiple pages on the site - and how would the browser determine whether the user has moved from one page to another within the website or moved out of the website completely?)
Thanks for reading this,
Paul.
I am making a website that will have users logging on and logging off. In my database, there is a table called 'User' and I have a filed in it called 'LoginFlag' which can have a value of 'out' or 'in'. This field is designed to prevent two users logging on under the same username and to display a list of who else is logged on to the website.
In an ideal world, people would click a log off button before they exit the browser, but as its not ideal, is there any way of triggering a database update when the browser is closed? The global.asa concept would not be ideal I don't think due to the 20minute timeout as people will be using the system frequently and may log on more than once in 20 minutes. Therefore the 'LoginFlag' field in the 'User' table would still say 'in' and thus prevent a log on under that username.
Is there any way I could do this?
Perhaps the 'LoginFlag' field isn't the proper way to do this and someone might have a better concept. I really need something that will let me run a piece of code to update the database when the user closes the browser (or leaves the site, but this may be tricky as there are multiple pages on the site - and how would the browser determine whether the user has moved from one page to another within the website or moved out of the website completely?)
Thanks for reading this,
Paul.