) Enables the PHP cookie to take effect in a timely manner and can be used without refreshing. how can this problem be solved?

Source: Internet
Author: User
(Switch) let the PHP cookie take effect in time. you can see this in php100 without refreshing it. let's turn it over and show it to you. it's useless and I didn't test it. usually, such a piece of code in php. click it in the browser. before the cookie appears .. how can we make the cookie take effect in a timely manner and share a very practical method to make the cookie take effect in a timely manner. the code is as follows: PHPcode/P (convert) to make the php cookie take effect in a timely manner, you can use it without refreshing
I can see this in php100, and I will show it to you. it does not work and I have no test.

Usually, such a piece of code in php. click it in the browser. before the cookie appears .. how can we make cookies take effect in a timely manner and share a practical method to make them take effect in a timely manner. the code is as follows:

PHP code
  // The php cookie setting function takes effect immediately and 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 really don't know what the original author thinks?
The cookie value is provided by you and is conditional.

Do I lie to myself when I assign a value to $ _ COOKIE?
------ Solution --------------------
What is $ s?
------ Solution --------------------
I don't understand. I saw it the first time.

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.