I am learning a Zend Framework. Its going really difficult to me as compare to CodeIgniter. I have a problem of the difference between normal cookies(php) and zend_http_cookies. I am using normal cookies in my Zend application, it works but I want to understand Zend_http_cookies and its pure concept, can anyone tell me this..
thnx in advance.
I am learning a Zend Framework. Its going really difficult to me as compare
Share
PHP cookie :
A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user’s computer. Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, you can both create and retrieve cookie values.
In PHP you can set cookie like this :
Example :
Zend_Http_Cookie:
Zend_Http_Cookie is a class that represents an HTTP cookie. It provides methods for parsing HTTP response strings, collecting cookies, and easily accessing their properties.
You can instantiate it using :
A cookie object can be transferred back into a string, using the __toString() magic method. This method will produce a HTTP request “Cookie” header string, showing the cookie’s name and value, and terminated by a semicolon (‘;’). The value will be URL encoded, as expected in a Cookie header:
Example:
For advance you should read zend documentation from framework.zend.com