I. session Overview _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
1. session Overview. I. session overview what is a session? I didn't understand it at the beginning. non-professional dictionaries are translated into meetings and meeting periods. Make an inappropriate metaphor (although not appropriate, it means the same I. session Overview
What is a session? I didn't understand it at the beginning. non-professional dictionaries are translated into meetings and meeting periods. Make an inappropriate metaphor.
(Although inappropriate, it means the same thing). session is the relationship between you and your website.
Session plays an important role in WEB technology. Because a web page is a stateless Connection program, you cannot know the browsing status of the user. Therefore, we must
The session is used to record user information for confirmation when the user requests the web server in this identity again. for example:
For example, users are often asked to log on to some websites, but how do we know that the user has logged on? if there is no session, the login information cannot be retained, do not provide the user name and password on each page.

Of course, sessions are not only used for user identity authentication, but may also be used in other aspects, as we will mention later.
The session is interpreted as the session period in Chinese. A session starts when a user enters a website and ends when he leaves the website. Session was first introduced in the dynamic scripting language Active Server Pages. it is powerful and cannot be clearly stated in one sentence.


When php is still in version 3.0, session is always a pain point. Although php has the advantages of fast execution speed, flexible use, and powerful functions, but due to session problems, many sites have abandoned php Development, at least my boss thinks so. At that time, many php free function libraries provided the solution to implement session on php3, but they all made people feel unauthentic. Just as if you spent thousands of oceans buying mobile phones but configured a rough grass bag, although the functions are the same, it is always awkward. The emergence of php4 gave php a chance to turn over the session issue. Although its session implementation is not ideal (mainly because of efficiency issues), it is implemented by itself and can be used in practice.
What are we doing with session? if you have been talking about it for a long time and I cannot use it, wouldn't you sell paper. OK. Let's take a look at the usage of the session: all people who have made websites have such experiences. the variables on the page (in this chapter, they refer to server variables, the same below) it cannot be used on the next page. although some methods can be implemented, such as form and urlstring, it is inconvenient for some users, even if the form is automatically submitted, however, the latency is sufficient to suffocate people in today's network conditions, and both methods obviously increase the burden on programmers. If you are developing a large project, the extra burden cannot be ignored. With session, the variables registered in the session can be used as global variables. What are global variables? Great. In this way, you know what is used: mainly used for user identity authentication, Program Status record, and parameter transfer between pages.

At the beginning, I didn't understand what the dictionary session was. non-professional dictionaries were translated into meetings and meeting periods. Make an inappropriate metaphor (although not appropriate, it means the same thing...

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.