I have a member who stays connected to the website for days on end, consuming CPU usage. I know that there is a admin adv setting to make them inactive, but is there a way to log them out so not to query messenger and use cpu?
I have a member who stays connected to the website for days on end, consuming CPU usage. I know that there is a admin adv setting to make them inactive, but is there a way to log them out so not to query messenger and use cpu? Vunderba..... Challenge Yourself to be the Best...... Hosting from Zarconia.net |
what you can try is to build in lil script that checks if the logged in member is not really active( idle time). if not then kill session after say: 60 min. I know this mod: Chat Auto Logout. |
Thank you for the reply. This mod or program would be useful. Hopefully someone has a small script that does this for dolphin. Otherwise anyone that has members stay online for convenience can definitely be a resource hog. Vunderba..... Challenge Yourself to be the Best...... Hosting from Zarconia.net |
You are welcome. you can do it with java script see example var inactivityTime =function(){var t; window.onload = resetTimer; document.onmousemove = resetTimer; document.onkeypress = resetTimer;function logout(){ alert("You are now logged out.")//location.href = 'logout.php'}function resetTimer(){ clearTimeout(t); t = setTimeout(logout,3000)// 1000 milisec = 1 sec}};
if you have programming skills you can do it... be carefull where you put the code. have not used it myself yet.
|
You could try this: Edit -> templates/base/_header.html ADD this code right before the </head> <script language="javascript" type="text/javascript"> It's set for 30 minutes. If the user doesn't move their mouse or press a key, they will be logged out. You can test this by making the timer shorter, say 10000 and reloading your website. http://ModMyCMS.com --> Dolphin Hacks &Mods |
just tested it and it works fine. good luck Itsawhiz |
TY, will try and let everyone know. Vunderba..... Challenge Yourself to be the Best...... Hosting from Zarconia.net |
It can have place in browser window, but usually this doesn't happen, or at least above solution should help. One more thing is desktop app, which stays in tray and make periodic requests to the server - user has to close it explicitly to stop it. The solution here is to uninstall Desktop app module, to prevent future installs. I have a member who stays connected to the website for days on end, consuming CPU usage. I know that there is a admin adv setting to make them inactive, but is there a way to log them out so not to query messenger and use cpu?
Rules → http://www.boonex.com/terms |
Worked perfectly, TY all again Vunderba..... Challenge Yourself to be the Best...... Hosting from Zarconia.net |
No problem! http://ModMyCMS.com --> Dolphin Hacks &Mods |
I suggest to change this block of code window.onload = function() { setTimeout("redir()" , 1800000 ) }; to this if (unescape(document.cookie.replace(new RegExp("(?:(?:^|.*;s*)" + escape("memberID").replace(/[-.+*]/g, "$&") + "s*=s*((?:[^;](?!;))*[^;]?).*)|.*"), "$1")) || null) { This prevents the script to logout again and again even the user is already logged out. Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81 |
I just saw that the original code doesn't reset the timer (maybe in IE it is doing). So i changed something (Event handling over "document"). Here is the complete working code (tested on FF, Chrome and IE8) <script language="javascript" type="text/javascript"> Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81 |
It would be nice to add a pop up saying your session is about to expire click on continue to stay logged in. Sort of like what godaddy.com uses when you stay idle on there site to long. Also how well will this play with memcache or accelerator if the cookie times are set different ? or will it not matter at all ? https://dolphin-techs.com - Skype: Dolphin Techs |
Some people like to stay logged in for convenience. They may leave the computer for a time and then return to look for new updates and comments. Logging them out too quickly is going to caused irritation and they may be inclined to just go elsewhere. So temper the amount of time you are thinking of a forced log-out. Here on Boonex, we can stay logged in for a week before we are logged out of the system. Note, doesn't the session cookie handle this? Or is the session cookie set to expire for an extremely long time? If so, isn't the answer to reduce the time the session cookie expires? Geeks, making the world a better place |
yeah but boonex is not using live chat or messenger and is not getting hit with a million xml calls.... https://dolphin-techs.com - Skype: Dolphin Techs |