Jahren Posted November 27, 2008 Share Posted November 27, 2008 Hi guys! here goes question #3! I am an admin and play around my account manager. I've found out a user that needs to be shutdown for various reasons. I've deleted the user in question but I would like him to get disconnected right away. How can I nullify his $_SESSION['uname'] from the server? In other words, Is there a way to manipulate someone else's SESSION vars. I do have auth protection at login. But I won't reconnect to the database everytime a user loads a single page. I just check if the $_SESSION['uname'] exists. Again : Is there a way to play with the array of session vars? Quote Link to comment https://forums.phpfreaks.com/topic/134554-solved-disconnect-an-other-user/ Share on other sites More sharing options...
ratcateme Posted November 27, 2008 Share Posted November 27, 2008 you could store the user ID in session then check then every time a user requests a page check that there ID is still in the database. Scott. Quote Link to comment https://forums.phpfreaks.com/topic/134554-solved-disconnect-an-other-user/#findComment-700583 Share on other sites More sharing options...
Jahren Posted November 27, 2008 Author Share Posted November 27, 2008 yeah, checking an ID seems a good alternative. so I'd have a table of connected users. a simple check of online users is far better than checking the whole auth table! thanks! edit : Tho it leads me to an other question I put a userID in that table upon login and remove it from the table on logout. How can I remove users that have timed out? edit2 : ahaha edit and reply at the same time Quote Link to comment https://forums.phpfreaks.com/topic/134554-solved-disconnect-an-other-user/#findComment-700590 Share on other sites More sharing options...
ratcateme Posted November 27, 2008 Share Posted November 27, 2008 i guess you would also want a cron job to take old entries out of the online table. Scott. Quote Link to comment https://forums.phpfreaks.com/topic/134554-solved-disconnect-an-other-user/#findComment-700596 Share on other sites More sharing options...
DarkWater Posted November 27, 2008 Share Posted November 27, 2008 Just check against the users table, don't bother with an online table. It'll cause extra overhead and be a pain to get working exactly how you want. Quote Link to comment https://forums.phpfreaks.com/topic/134554-solved-disconnect-an-other-user/#findComment-700598 Share on other sites More sharing options...
Jahren Posted November 27, 2008 Author Share Posted November 27, 2008 I don't have a clue on how I can do this tho. When would that be triggered? Is there some sort of Event() when a session dies? I guess you're right DarkWater Edit : I think i'll go with a counter system i'll try to auth from the table every five pages you load or something Quote Link to comment https://forums.phpfreaks.com/topic/134554-solved-disconnect-an-other-user/#findComment-700602 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.