ngreenwood6 Posted September 11, 2008 Share Posted September 11, 2008 I have 2 values that I have stored in the database: 'logged_in_ip' and 'logged_in'. The first one logs there ip while they are logged in. The second one sets a value of 1 to logged_in when they are logged in so that no other user can log in with the same username while they are. I have set it so that when they log out it sets the ip to blank and the value of logged_in to 0. The problem that I am having is that if they dont go to the logout page and just exit the site it doesnt change these values. Does anyone know how I can force them to log out if they close the window or a better method to do this. Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/123810-database/ Share on other sites More sharing options...
BlueSkyIS Posted September 11, 2008 Share Posted September 11, 2008 you could set a custom session save handler, defining something to do when the user's session ends, whether it's via closing the browser or normal garbage collection (gc): http://us3.php.net/manual/en/function.session-set-save-handler.php Quote Link to comment https://forums.phpfreaks.com/topic/123810-database/#findComment-639256 Share on other sites More sharing options...
ngreenwood6 Posted September 11, 2008 Author Share Posted September 11, 2008 That looks like something that could be useful but I am confused by the link that you have given to me. I am kinda a noob to php and mysql but am learning my way around. If someone could give me a basic example of how to use this session save handler to interact with mysql that would be great. Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/123810-database/#findComment-639277 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.