php和javascript Cookie之间的区别 [英] Differences between php and javascript cookies

查看:96
本文介绍了php和javascript Cookie之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

Javascript cookie vs PHP Cookie

在服务器上,这是否意味着PHP的Cookie会与JavaScript Cookie不同?是这样,分歧会是什么?谢谢。

Since php scripts are executed on the server, does that mean that php cookies will behave differently from javascript cookies? Is so, what will the differences be? Thank you.

推荐答案

没有PHP cookies。存储在客户端浏览器上的 HTTP Cookie 。 PHP允许您通过使用发出的Set-Cookie HTTP头设置和读取cookie,但所有这是标准的HTTP协议的东西,没有PHP相关。但有一件事:使用 HttpOnly 标志发出的Cookie无法通过客户端脚本访问。

There is no such thing as PHP cookies. There are HTTP cookies which are stored on the client browser. PHP allows you to set and read cookies by using emitting the Set-Cookie HTTP header, but all that is standard HTTP protocol stuff, nothing PHP related. There is one thing though : cookies emitted with the HttpOnly flag are not accessible by client scripts.

这篇关于php和javascript Cookie之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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