如果我们在PHP session_name中使用点,为什么浏览器会丢失会话?

Can anyone explain to me why the browser loses the session if we use a dot (.) in the session_name?

Example:

session_name('abc'); // works        
session_name('a.bc'); // doesn't work    

From PHP session_name() docs:

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.

Note "It should contain only alphanumeric characters".

The PHP docs state that the $name given to session_name($name)

should contain only alphanumeric characters;

Thus, a new session name is generated when the one you give it is invalid.