Saturday, December 10, 2022

log out all users from php sessions based website - and superuser shell for shell wildcard expansions

There was a request to log out all users from the website based on this code. At first I thought just restarting the server after applying some updates would do it. But no. 

Since our site was based on php sessions and nothing was being saved to the database for user sessions, here is what worked:
First found the path using a small php page which had the line 
php echo session_save_path()
(or phpinfo would have worked?)

then just 
sudo sh -c 'rm -v /var/lib/php/sessions/sess*'

About why just 
sudo rm sess* 

No comments:

Post a Comment