问题描述:

I want to know if is it okay to name a cookie starting with a number. Actually, I've tested the following code using Apache2.2.21, PHP 5.3.8 and Chrome 19.0.1084.46:

setcookie('1test', 'a value');

if (isset($_COOKIE['1test'])) echo $_COOKIE['1test'];

It works just fine under these conditions, but what I want to know: is there any spec or RFC that recommends not to do it?

网友答案:

I don't see anything in the specs that says you can't use a number as the first character in a cookie's name.

相关阅读:
Top