Zend 框架 cookie 管理 [英] Zend Framework cookie management

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

问题描述

我想知道 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 字符串并针对给定的 HTTP 请求场景测试 cookie.它的主要目的是通过 Zend_Http_ClientZend_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 框架 cookie 管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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