Bounce All Users Out of Database

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
User avatar
toconnell
Veteran Member
Posts: 204
Joined: 2013-04-09 19:29
Location: Oklahoma City, OK
Contact:

Bounce All Users Out of Database

Post by toconnell » 2013-11-04 22:16

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
Tina O'Connell
Web Dev & Appgini FAN

AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Re: Bounce All Users Out of Database

Post by AhmedBR » 2013-11-04 22:57

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.
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 356
Joined: 2013-03-21 04:37

Re: Bounce All Users Out of Database

Post by peebee » 2013-11-05 03:05

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.

User avatar
toconnell
Veteran Member
Posts: 204
Joined: 2013-04-09 19:29
Location: Oklahoma City, OK
Contact:

Re: Bounce All Users Out of Database

Post by toconnell » 2013-11-14 16:34

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.
Tina O'Connell
Web Dev & Appgini FAN

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Bounce All Users Out of Database

Post by KSan » 2014-01-13 02:44

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.

Post Reply