Where is the cookie stored that session_start() uses?

对着背影说爱祢 提交于 2020-01-06 06:14:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!