2

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.

1
  • Why do you think so? Or, in other words, why do you think there should be a better way that won't involve erasing all the session files?
    – raina77ow
    Commented Apr 2, 2014 at 7:00

2 Answers 2

0

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

0

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.