[PHP] using session Sessions

Source: Internet
Author: User

<?php/*  cookie-less information stored on the client (cookie) session-address cookie size limit/quantity/other  Setcookie ()-Set cookie to generate cookie file on client , can be kept: expiry time; name; Value ...  *  */setcookie (' name ', ' Lee ', Time () + (7*24*60*60));/*  * Read COOKIE *  */if (isset ($_cookie[' name ')) {echo $_ cookie[' name '];} /  * * Delete COOKIE *  *  */if (isset ($_cookie["name")) {Setcookie ("name", ""), Setcookie ("name", "Lee", Time ()-1 );} /  * * Cookie Usage Restrictions: * 1. Must be set in the HTML file content output {before}  ; * 2. The processing of cookies by different browsers  (inconsistent); * 3. The limit is on the client. * A browser can create up to [3 0 x]cookie; * Each cookie cannot exceed 4KB; * The total number of cookies that can be set per Web site cannot exceed 20. *  *  *//* session *//*  start {session} with Session_Start (). *  *///Create session and read Sessionsession_start (); Echo "<br>"; $_session[' name ']= "Leee"; Echo $_session["name"];//set the session will immediately be able to use/* to determine whether the session exists? *///session_start (); $_session["name"]= "Leee", if (Isset ($_session["name")) {echo $_session["name"];}? >

  

[PHP] using session Sessions

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.