PHP cookie names cannot use periods (periods). We should say that they can use periods (periods) of cookie names, but they will be converted. You need to know why.
Php cookie names cannot use periods (periods). We should say that they can use periods (periods) of cookie names, but they will be converted. You need to know why.
This title is not very strict. It should be said that you can use the cookie name of the dot number, but it will be converted. You name a cookie:
$ _ COOKIE ['my. name'] = 1;
In fact, you cannot find this value in the cookie through 'My. name'. It can only be 'my _ name ':
Echo $ _ COOKIE ['my _ name'];
Php has automatically converted to underline.
Why does php do this? This is because $ _ GET/$ _ POST/$ _ SERVER/$ _ COOKIE... In many previous versions, the values of these global functions can be directly accessed locally using the register_globals parameter. For example, after register_globals = on is enabled, the value of $ my_name for access is 1. If it is $ my. name, it does not comply with the naming principles of php variables. This is not just a problem of periods.
Therefore, the $ _ COOKIE name complies with the php Naming Standard.
In addition, enabling register_globals is a bad decision, because it may overwrite the original value in the script, for example:
// Other code
If ($)
$ Uc_is_login = true;
//...
The user only needs to send a url? A = 1 http request can be logged in by default. This is a very dangerous practice and should be disabled. In fact, php6 has removed this option.