In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces php how to log out to clear session, the article is very detailed, has a certain reference value, interested friends must read it!
Php login clear session implementation methods: 1, clear the session value; 2, determine whether the client's cookie file exists, then set it to expire; 3, clear the server's sesion file.
This article operating environment: Windows7 system, PHP7.1 version, Dell G3 computer
How does php log out to clear session?
PHP most thoroughly log out, clear the code of session and cookie
Public function logout () {$_ SESSION = array (); / / clear session value. If (isset ($_ Cookie [session _ name ()]) {/ / determines whether the client's cookie file exists, and sets it to expire if it exists. Setcookie (session_name (),', time ()-1);} session_destroy (); / / clear the server's sesion file}
When logging out, if the session or cookie is not cleaned clean, it will often cause all kinds of fantasy problems. Especially if your session is stored in a database driver on the server. Use the above code to clean it up thoroughly.
The above is all the contents of the article "how to log out and login to clear session" in php. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.