(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