session_start()使用的cookie存储在哪里?

问题描述:

在哪里可以找到session_start使用的cookie?

Where can I find the cookie that session_start uses?

对于具有默认设置的标准PHP会话,您可以获取Cookie键/值,其中:

For standard PHP sessions with default settings, you can get the cookie key/value with:

 session_name() -> session cookie's KEY
 session_id() -> session cookie's VALUE

不过,请注意,您写入$ _SESSION的内容都是 >存储在cookie本身中。会话cookie仅包含会话ID值。 $ _SESSION中写入的数据存储在服务器上-通常存储在文件中,除非您滚动了自己的会话处理程序并以其他方式存储它。

However, note that whatever you write to $_SESSION is NOT stored in the cookie itself. The session cookie contains ONLY the session ID value. The data your write in $_SESSION is stored on the server - usually in a file, unless you've rolled your own session handlers and are storing it in a different manner.