This article mainly introduces PHP Session control: Session and Cookie Details. This article describes Session and Cookie related knowledge in PHP in detail and covers a wide range of topics, for more information about PHP session control, see the
This article introduced the PHP session control, mainly elaborated the following several things:
• Background/concept of Session controlMaintenance and life cycle of • Cookies (effective time)Maintenance and life cycle of session (recovery
{Code ...} the value 1 of $ _ SESSION [& #039; id & #039;] is retrieved after unset ($ _ SESSION) is used; session_start () is refreshed next time! The unset ($ _ SESSION [& #039; id & #039;]) can be cleared normally! Who can tell me in detail?
This article describes in detail the use of session in php, a good example to help you learn, easy to understand. Previous
Session technology is similar to Cookie technology, and is used to store user-related information. But the biggest difference
The Chinese translation of a Session is called "Session". its original meaning refers to a series of actions/messages starting and ending, for example, a series of processes from picking up a phone call and dialing to hanging up a phone call can be
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
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
$_SESSION['id'] = 1;
The unset($_SESSION); next time you refresh session_start(); the page,
$_SESSION['id']The values are = 1 out again!
And unset($_SESSION['id']); the use can be cleared normally!
Who can tell the details, thank you!
Reply
The biggest difference between a session and a cookie is that the session is stored in the server's memory.And the cookie is saved with the browser or client file inside;Session is an access-based process that records the beginning and end of an
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
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.