<i id='qABJ3'><tr id='qABJ3'><dt id='qABJ3'><q id='qABJ3'><span id='qABJ3'><b id='qABJ3'><form id='qABJ3'><ins id='qABJ3'></ins><ul id='qABJ3'></ul><sub id='qABJ3'></sub></form><legend id='qABJ3'></legend><bdo id='qABJ3'><pre id='qABJ3'><center id='qABJ3'></center></pre></bdo></b><th id='qABJ3'></th></span></q></dt></tr></i><div id='qABJ3'><tfoot id='qABJ3'></tfoot><dl id='qABJ3'><fieldset id='qABJ3'></fieldset></dl></div>
      <bdo id='qABJ3'></bdo><ul id='qABJ3'></ul>
    <tfoot id='qABJ3'></tfoot>

      1. <legend id='qABJ3'><style id='qABJ3'><dir id='qABJ3'><q id='qABJ3'></q></dir></style></legend>

        <small id='qABJ3'></small><noframes id='qABJ3'>

      2. php setcookie vs Zend_Http_Cookie

        时间:2023-10-02

          <i id='FXvcb'><tr id='FXvcb'><dt id='FXvcb'><q id='FXvcb'><span id='FXvcb'><b id='FXvcb'><form id='FXvcb'><ins id='FXvcb'></ins><ul id='FXvcb'></ul><sub id='FXvcb'></sub></form><legend id='FXvcb'></legend><bdo id='FXvcb'><pre id='FXvcb'><center id='FXvcb'></center></pre></bdo></b><th id='FXvcb'></th></span></q></dt></tr></i><div id='FXvcb'><tfoot id='FXvcb'></tfoot><dl id='FXvcb'><fieldset id='FXvcb'></fieldset></dl></div>

              <tbody id='FXvcb'></tbody>

          1. <legend id='FXvcb'><style id='FXvcb'><dir id='FXvcb'><q id='FXvcb'></q></dir></style></legend>
            1. <tfoot id='FXvcb'></tfoot>
                • <bdo id='FXvcb'></bdo><ul id='FXvcb'></ul>
                • <small id='FXvcb'></small><noframes id='FXvcb'>

                • 本文介绍了php setcookie vs Zend_Http_Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  为什么这段代码不起作用,我怎样才能让它像

                  Why this code not working, and how can I make it works like

                  setcookie('cookie_name','cookie_value');

                  不创建cookie的代码:

                  $cookie=new Zend_Http_Cookie('cookie_name','cookie_value','.google.com');
                  

                  或者有什么区别:

                  setcookie('cookie_name','cookie_value');
                  

                  对比

                  $cookie=new Zend_Http_Cookie('cookie_name','cookie_value','.google.com');
                  

                  谢谢

                  推荐答案

                  Zend_Http_Cookie 不是用来设置 cookie 的,它是 Zend_Http_Client 的配套类.假设您想从站点中截取一些内容,但该内容只有在您登录后才可用.您可以使用 Zend_Http_Client 将您的凭据发布到登录表单,然后服务器将发送回会话 cookie.然后,您可以在对要抓取的页面的后续请求中包含此会话 cookie,以模拟登录用户查看该页面.

                  Zend_Http_Cookie is not for setting cookies, it is a companion class for Zend_Http_Client. Let's say you wanted to screen scape some content off a site but that content is only available if you are logged in. You could use Zend_Http_Client to post your credentials to the login form, the server would then send back a session cookie. You could then include this session cookie in a subsequent request to the page you want to scrape in order to simulate a logged in user viewing that page.

                  要在 ZF 中设置 cookie,您可以只使用本机 PHP 函数,或者可能将数据存储在会话中.

                  To set cookies in ZF you can just use the native PHP function, or possibly store the data in the session instead.

                  这篇关于php setcookie vs Zend_Http_Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Zend Framework 中的数据库事务:它们是孤立的吗? 下一篇:如何在 Zend 框架 1 应用程序中使用 twitter bootstr

                  相关文章

                  最新文章

                  <legend id='BrmL3'><style id='BrmL3'><dir id='BrmL3'><q id='BrmL3'></q></dir></style></legend>
                    <bdo id='BrmL3'></bdo><ul id='BrmL3'></ul>
                • <i id='BrmL3'><tr id='BrmL3'><dt id='BrmL3'><q id='BrmL3'><span id='BrmL3'><b id='BrmL3'><form id='BrmL3'><ins id='BrmL3'></ins><ul id='BrmL3'></ul><sub id='BrmL3'></sub></form><legend id='BrmL3'></legend><bdo id='BrmL3'><pre id='BrmL3'><center id='BrmL3'></center></pre></bdo></b><th id='BrmL3'></th></span></q></dt></tr></i><div id='BrmL3'><tfoot id='BrmL3'></tfoot><dl id='BrmL3'><fieldset id='BrmL3'></fieldset></dl></div>

                  <small id='BrmL3'></small><noframes id='BrmL3'>

                    1. <tfoot id='BrmL3'></tfoot>