问题描述
我在玩饼干.而且我没有任何名为 PHPSESSID 的 cookie.
I'm playing around with cookies. And I dont have any cookies called PHPSESSID.
我需要吗?我可以删除它吗?
Do i need it? Can i remove it?
它的功能"是什么?
if (count($_POST)) {
setcookie("TestCookie", htmlspecialchars($_POST['val']), time()+3600);
}
print_r($_COOKIE);
打印:
Array
(
[TestCookie] => blabla
[PHPSESSID] => el4ukv0kqbvoirg7nkp4dncpk3
)
推荐答案
PHP 使用两种方法之一来跟踪会话.如果启用了 cookie,就像您的情况一样,它就会使用它们.
PHP uses one of two methods to keep track of sessions. If cookies are enabled, like in your case, it uses them.
如果 cookie 被禁用,它会使用 URL.虽然这可以安全地完成,但它更难,而且通常不是.参见,例如,会话固定.
If cookies are disabled, it uses the URL. Although this can be done securely, it's harder and it often, well, isn't. See, e.g., session fixation.
搜索它,您会得到很多 SEO 建议.传统观点是您应该使用 cookie,但 php 会以任何一种方式跟踪会话.
Search for it, you will get lots of SEO advice. The conventional wisdom is that you should use the cookies, but php will keep track of the session either way.
这篇关于PHPSESSID 是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)