In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the meaning of Session in Web, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Session in Web refers to the time it takes for a user to visit a website from the time he enters the site to the time the browser is closed, that is, the time it takes the user to browse the site. So we can see from the above definition that Session is actually a specific concept of time. It is important to note that the concept of a Session needs to include a specific client, a specific server, and uninterrupted operating time. The Session in which the A user and the C server establish the connection are two different Session when they establish the connection with the B user and the C server.
How sessionstart works
(1) when a session is enabled for the first time, a unique identity is stored in the local cookie.
(2) first, using the session_start () function, PHP loads the stored session variables from the session repository.
(3) when executing the PHP script, register the session variable by using the session_register () function.
(4) when the execution of the PHP script ends, the session variables that have not been destroyed are automatically saved in the local session library under a certain path, which can be specified by session.save_path in the php.ini file and can be loaded and used the next time you browse the web.
Session is stored on the server side. By default, the SESSION save method set in php.ini is files (session.save_handler=files), even if the SESSION data is saved by reading and writing files, while the directory saved by the SESSION file is specified by session.save_path, and the file name is prefixed with sess_, followed by SESSIONID, such as: sess_c72665af28a8b14c0fe11afe3b59b51b. The data in the file is the serialized SESSION data.
What does sessionstart pay attention to?
If you have a large number of visits, you may generate more SESSION files. At this time, you can set up a hierarchical directory to save SESSION files, and the efficiency will be improved a lot. The setting method is: session.save_path= "Numbababash saving path", N for the graded series, and save_path for the start directory.
When writing SESSION data, PHP will get the SESSION_ID of the client, and then according to this SESSIONID to the specified SESSION file storage directory to find the corresponding SESSION file. If it does not exist, it will be created. Finally, the data will be serialized and written to the file. Reading SESSION data is Session and Cookie in php
In contrast to the fact that Cookie,session is a server-side session stored in PHP development, which is relatively secure and does not have storage length restrictions like Cookie, this article briefly introduces the use of session.
Because Session is stored on the server as a text file, it is not afraid of the client side to modify the Session content. In fact, on the server side of the Session file, PHP automatically modifies the permissions of the session file, retaining only the system read and write permissions, and can not be modified through ftp, so it is much safer.
Thank you for reading this article carefully. I hope the article "what is the meaning of Session in Web" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.