I want to update some database table for that I need to logout all the active users so that I can restart EC2 and RDS server. I tried to delete all session files but I think it's not the right way to achieve this.
2 Answers
if you are using database-sessions in your project, all the login sessions are stored in the database itself... Then clearing the session table in db will logout all the active sessions..
Ref: http://book.cakephp.org/2.0/en/development/sessions.html#database-sessions
You can force php to destroy all sessions
ini_set('session.gc_max_lifetime', 0);
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 1);
I suggest that it will be better if you're using the Database sessions.