What is a session?
The Chinese translation of the session is called "conversation", its original meaning refers to the beginning and end of a series of actions/messages, such as phone calls from the pick up the telephone to hang up the phone in the
1, what is the session.
The Chinese translation of the session is called "conversation", whose meaning is a series of actions/messages from the beginning to the end, such as calling from the phone to the telephone to hang up the phone in the middle
Session is divided into two parts, session space is stored on the server side, open the ID of the space in the client's cookie, if the client shuts down the cookie,session can not be used normally.
Source: http://wsiyu.com/read.php?tid=526
The
1. How PHP session worksThe Session file is stored on the server. By default, the Directory of the SESSION file is specified by session. save_path. The file name is prefixed with sess _ and followed by session id, for example, sess_c000065af28a8b14c0
1. How PHP Session Works
Session file is stored on the server side, by default, the directory saved by the session file is specified by Session.save_path, the file name is prefixed with Sess_, followed by the session ID, such as: Sess_ c72665af28a8b1
This article mainly introduces the use of Redis alternative file storage session method, combined with the case of a detailed analysis of the session of the basic operating methods and the use of Redis storage session related skills, the need for
PHP uses the file storage session by default, which is very inefficient if the concurrency is large. Redis's support for high concurrency is very good, so you can store the session using Redis alternative files.Here, we introduce the function of PHP
The Chinese translation of the session is called "conversation", whose meaning is a series of actions/messages from the beginning to the end, such as calling from the phone to the telephone to hang up the phone in the middle of a series of processes
2.7How to delete a session
(1) unset ($ _ session ['xxx']) deletes a single session. unset ($ _ session ['xxx']) is used to unregister a registered session variable. It works the same as session_unregister. Session_unregister () is no longer used in
In the implementation of the session, cookie technology is used to save a cookie containing the session_id on the client, and to save additional session variables on the server side, such as Session_name and so on. When the user requests the server
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.