PHP Session Control

Source: Internet
Author: User
Tags php session set cookie

Session control

HTTP protocol, based on the TCP protocol.
HTTP protocol called Stateless protocol

SESSION COOKIE

Session features: 1. stored on the server. 2. Each user will generate a session. 3. There is a default expiration time of about 15 minutes. 4. Can store any type of data

Cookie features: 1. stored on the client. 2. Each user will generate one. 3. There is no expiration time by default. 4. Only strings can be stored

<body><? PHP Session_Start // turn on the use of Session//session//1. The page using session must be opened in the first line of the code $_session // assignment//echo $_session["UID"];       Value//cookie use setcookie// Assignment (set cookie)? ><a href= "huihuakongzhi1.php" > Jump </a></body>
View Code
<body><? PHP Session_Start (); Echo $_session ["UID"]; Echo $_cookie ["UID"]; // Take cookie value ?></body>
View Code

PHP Session Control

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.