Zend Framework的cookie管理 [英] Zend Framework cookie management
问题描述
我想知道Zend Framework是否有任何类处理cookie。一个包含php setcookie()
函数的类。
。提前感谢。
i want to know if Zend Framework has any class for handling cookies. a class that wraps php's setcookie()
function for example.
thanks in advance.
推荐答案
Zend_Http_Cookie
只是创建RFC兼容的Cookie字符串和测试Cookie的组件针对给定的HTTP请求场景。其主要目的是通过 Zend_Http_Client来协助Cookie情况 c $>
我假设您已在 Zend_Http
寻找一个包装器设置cookie - 也许比较 Zend_Session
。目前没有可协助您建立Cookie的组件( setcookie()
是正确的方法)。要读取Cookie,您可以使用适当的方法 Zend_Controller_Request_Http
:: getCookie($ key = null,$ default = null)
。
I assume that you're looking for a wrapper set cookies - perhaps compared to Zend_Session
. There currently is no such component to assist you with creating cookies (setcookie()
is the right way to go). To read cookies you can resort to the appropriate method Zend_Controller_Request_Http
::getCookie($key = null, $default = null)
.
这篇关于Zend Framework的cookie管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!