session_start()使用的cookie存储在哪里? [英] Where is the cookie stored that session_start() uses?

查看:182
本文介绍了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.

这篇关于session_start()使用的cookie存储在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆