問題描述
我想知道 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_Client
在 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 框架 cookie 管理的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!