(turn) Let PHP cookie take effect in time, can use without refreshing, how to deal with

Source: Internet
Author: User
(turn) Allow PHP cookies to take effect in time and use them without refreshing
See this in php100, turn around to show everyone, there is no effect I did not test.

Usually, PHP, such a piece of code. To have a browser brush. To appear cookies. How to make the cookie effective in time, to share a way to make cookies effective in time, very practical, the code is as follows:

PHP Code
  
  The PHP cookie setting function takes effect immediately, supports Array function cookies ($var, $value = ', $time =0, $path = ', $domain = ') {$_cookie[$var] = $value;  if (Is_array ($value)) {foreach ($value as $k = = $v) {Setcookie ($var. ' ['. $k. '] ', $v, $time, $path, $domain, $s);  }}else{Setcookie ($var, $value, $time, $path, $domain, $s); }  }


------Solution--------------------
I don't know what the original author thinks.
The value of the cookie is yours, and it's conditional.

Oneself to $_cookie assignment value not oneself deceive oneself?
------Solution--------------------
What's that $s?
------Solution--------------------
Can't see, the first time I see
  • 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.