Home > Backend Development > PHP Problem > How to clear server session in php

How to clear server session in php

coldplay.xixi
Release: 2023-03-05 15:48:01
Original
3321 people have browsed it

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的目录那么进入对应目录删除)
Copy after login

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
Copy after login
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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template