Page 1 of 1

Bounce All Users Out of Database

Posted: 2013-11-04 22:16
by toconnell
I would like to bounce all users out of my database.. it would be so nice to click a button to do this in the ADMIN area..

For updates and such where you don't want anyone in he database. Or for those that keep it open. My database is getting very big and when all the users keep their windows open it slows down the system lately to a crawl.

I am trying to change that. Perhaps a timeout limit for each user.. like 60 minutes... would be nice.

Thanks, Tina

Re: Bounce All Users Out of Database

Posted: 2013-11-04 22:57
by AhmedBR
Put a timer on the session, this is already shared here, and works beautifully:
http://forums.appgini.com/phpbb/viewtopic.php?f=4&t=40

I use 30 minutes.

Re: Bounce All Users Out of Database

Posted: 2013-11-05 03:05
by peebee
I could be wrong but I think one single line of code in inCommon.php will achieve the same result by killing any session after a set time, defined in seconds

In inCommon.php, find the code at (around) line 54

Code: Select all

if(session_id()){ session_write_close(); }
	@ini_set('session.save_handler', 'files');
	@ini_set('session.serialize_handler', 'php');
	@ini_set('session.use_cookies', '1');
	@ini_set('session.use_only_cookies', '1');
	@ini_set('session.cache_limiter', 'nocache');
and add

Code: Select all

@ini_set('session.cookie_lifetime', '1800');
immediately above

Code: Select all

@ini_set('session.save_handler', 'files');
Session Lifetime is defined in seconds, so the '1800' in the code snippet above refers to 1800 seconds which is 30 minutes (change to '900' for 15 mins, etc...)

Reference: http://php.net/manual/en/function.sessi ... params.php

That should work. It works for me.

Re: Bounce All Users Out of Database

Posted: 2013-11-14 16:34
by toconnell
That is great for keeping them from staying logged in.. but what if I want to do an update and make sure a user is not half way through a record. It would be nice to give them a 5 minute warning and then boot them out giving them a chance to complete the changes to a record or a new entry and then log off themselves. If they don't log off it would automatically log them off.

Re: Bounce All Users Out of Database

Posted: 2014-01-13 02:44
by KSan
I posted the same feature suggestion about a year ago : http://forums.appgini.com/phpbb/viewtopic.php?f=6&t=20

I still think it would be great to do this. Hope Ahmad catches up with his backlog and manages to get to some of these nice to have features as well.