Command line for cleaning php session in linux window

I have a LAMP stack on AWS centOS linux. After updating my site, I would like to force all users to log in, clearing all sessions.
What is the best way to do this?
Is there a way to clear all sessions currently in PHP?

+4
source share
2 answers

It really depends on where your application stores the session. If you did not manually override the session handler in your project, it will by default use the path that is in your php.ini file. To find the php.ini file:

$ find / -name php.ini

On CentOS, it is usually located in /etc/php.ini.

php.ini ( /tmp PHP-FPM CentOS):

session.save_path = "/var/lib/php/session"

:

$ rm -Rf /var/lib/php/session/*

. , , .

+5

"-". , . php , , , .

: http://us.php.net/manual/en/session.configuration.php#ini.session.save-path

: centos. /var/lib/php/session

rm -rf /var/lib/php/session/* 

, , .

+1

Source: https://habr.com/ru/post/1539202/


All Articles