PHP中默认的sessionid为PHPSESSID;
当然,也可以通过
string session_name ([ string $name
] )
来修改, 官方说明:
name
The session name references the name of the session, which is used in cookies and URLs (e.g. PHPSESSID). It should contain only alphanumeric characters; it should be short and descriptive (i.e. for users with enabled cookie warnings). If name
is specified, the name of the current session is changed to its value.
疑问: 只能包含字母和数字?
参考源码:
- 不能全数字
- 当然,sessionid毕竟是个cookie name,也会遵循cookie name的检查(参看: http://phpor.net/blog/post/1122 )
- 没有发现哪里体现“只能包含字母和数字”,实测也发现,其实 dot、_ 都是可以的