问题
Where can I find the cookie that session_start uses?
回答1:
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
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.
来源:https://stackoverflow.com/questions/8630448/where-is-the-cookie-stored-that-session-start-uses