JQuery和PHP Cookie [英] JQuery and PHP Cookies

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

问题描述

假设我使用jQuery的Cookie插件创建一个Cookie:

  $。cookie('Cookie' ,1);我可以使用php来读取它:


  echo $ _COOKIE [Cookie]; 


解决方案

是的。



每个HTTP GET或POST发送到从Cookie设置的域/路径创建的服务器,直到它过期。


Let's say I make a cookie using jQuery's Cookie Plugin:

$.cookie('Cookie', "Cookie Value", 1);

Can I read it using php with:

echo $_COOKIE["Cookie"];

解决方案

Yes.

The cookie is sent back with every HTTP GET or POST to the server made from the domain/path the cookie is set to, until it expires.

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

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