neropt Posted May 22, 2006 Share Posted May 22, 2006 Hi!I have a problem with my login system:When one user (ex. "[b]nero[/b]") makes the login, in sql table "[b]users[/b]" on the user "[b]nero[/b]" i update the column "[b]estado[/b]" to [u]'01'[/u] (means "online") and register is session id in the column "[b]SID[/b]". when he does the logout i set "[b]estado[/b]" to [u]'00'[/u] (means "offline") and the "[b]SID[/b]" to [u]""[/u].This script allow me to prevent multiple logins with the same username and to have a statistics on my site.the problem is:Everyone closes the browser without login, therefore the column "[b]estado[/b]" continues with the value [u]'01'[/u] and "[b]SID[/b]" with the old session_id.If there's a way to list all the session_id active on the site i can control the users that closes the browser without making the logout.If that isn´t possible what's another method to check this? (i've read that we can do that with time control, but if you set that time to 10 min., and the user makes the login and closes the browser (ex. in the first minute), then when returns to the site we can't make the login and have to wait 9 minutes...Any ideias??ThanksP.S.: Sorry for my poor english.. Quote Link to comment https://forums.phpfreaks.com/topic/10220-sid/ Share on other sites More sharing options...
michaellunsford Posted May 23, 2006 Share Posted May 23, 2006 Maybe this is too simple. Give them the option to kick off the previous login. Quote Link to comment https://forums.phpfreaks.com/topic/10220-sid/#findComment-38151 Share on other sites More sharing options...
neropt Posted May 24, 2006 Author Share Posted May 24, 2006 And how do i know if the user is really th owner of the account?? Quote Link to comment https://forums.phpfreaks.com/topic/10220-sid/#findComment-38422 Share on other sites More sharing options...
.josh Posted May 24, 2006 Share Posted May 24, 2006 umm... well, that's what the login script itself is for... to validate the user... Quote Link to comment https://forums.phpfreaks.com/topic/10220-sid/#findComment-38424 Share on other sites More sharing options...
neropt Posted May 24, 2006 Author Share Posted May 24, 2006 But i already control the users account, the problem is i set a value to '01' when user logins and to '00' when he logouts, but generally they just close the browser.. and the value continues '01' (wich indicates that the user is online)..when they return to the page and try to make the login they can't because the script assume that he's already logged in..I want a way to know the users currently online (SID or IP), is there any way to do this?Thanks Quote Link to comment https://forums.phpfreaks.com/topic/10220-sid/#findComment-38427 Share on other sites More sharing options...
.josh Posted May 24, 2006 Share Posted May 24, 2006 perhaps you can use ajax with an onclose function to update the number? Quote Link to comment https://forums.phpfreaks.com/topic/10220-sid/#findComment-38430 Share on other sites More sharing options...
michaellunsford Posted May 24, 2006 Share Posted May 24, 2006 that or put a time limit on the login. So, instead of a 01, you'd just put the current time. If it's older than, say, fifteen minutes, then consider them off. Quote Link to comment https://forums.phpfreaks.com/topic/10220-sid/#findComment-38433 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.