Home  >  Article  >  Backend Development  >  How to clear server session in php

How to clear server session in php

coldplay.xixi
coldplay.xixiOriginal
2020-09-01 14:30:003117browse

php method to clear the server session: first clear the server session using [delete all files under /tmp]; then restart all background services; finally the user needs to log in again.

How to clear server session in php

Related learning recommendations: php graphic tutorial

How to clear server session in php:

删除 /tmp 下的所有文件(默认php的session文件是在/tmp下存着,直接此目录即可,如果改过php session的目录那么进入对应目录删除)

An error will be reported when accessing the website after deletion! An error will be reported when accessing the website! An error will be reported when accessing the website!

Solution:

Restart all background services. For example:

mysql

#nginx

php-fpm

*It will return to normal after restarting. All users need to log in again.

Command attached:

rm -rf /tmp/*
service mysql restart
service nginx restart
service php-fpm restart

Related learning recommendations:

php programming (video)

The above is the detailed content of How to clear server session in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn