PHP cookie Midpoint (period) automatically turns to underline problem, cookie underline
PHP cookies can not use the dot (period), in fact, is not very strict, it should be said that you can use the dot number of the cookie name, but will be converted, you name a cookie:
$_cookie[' my.name '] = 1;
In fact, you cannot find this value in a cookie by ' my.name ', Only ' my_name ':
echo $_cookie[' My_name '];
PHP has automatically converted you, and the period turns to underline.
Why does PHP want to do this? This is because $_get/$_post/$_server/$_cookie ... The values of these global functions, in many previous versions, can be accessed directly locally by the Register_globals parameter, for example, when register_globals = On is on, access to the $my_name directly takes a value of 1. If it is $my.name, then it does not conform to the PHP variable naming principle, which is not just a period (.) problem.
As a result, $_cookie's name already conforms to the PHP naming standard.
Also, turning on register_globals is a bad decision because it might overwrite the original values in the script, such as:
Other code
if ($a)
$uc _is_login = true;
// ...
The user simply sends a url?a=1 HTTP request to be logged on by default. This is a very dangerous practice and it should be shut down. In fact, PHP6 has removed this option.
PHP Cookie Usage Issues
Setcookie ("name", "Val", Expire_time, "/", ". domain.com");
The domain.com is preceded by a full stop so that it can be applied to subdirectories in the domain.com.
"/" is the root directory.
This way you can get a saved cookie there.
PHP cookie problem, 100 help
You this, the domain name can use underline? My understanding is only to use the underlined bar!
http://www.bkjia.com/PHPjc/897693.html www.bkjia.com true http://www.bkjia.com/PHPjc/897693.html techarticle PHP Cookie Midpoint (full stop) automatically turn to underline problem, cookie underline PHP cookie can not use dot (period), in fact, is not very strict, it should be said can use the dot number of ...