• <legend id='IHAnx'><style id='IHAnx'><dir id='IHAnx'><q id='IHAnx'></q></dir></style></legend>

    • <bdo id='IHAnx'></bdo><ul id='IHAnx'></ul>

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

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

        php setcookie vs Zend_Http_Cookie

        时间:2023-05-30
        <tfoot id='Nt2Qm'></tfoot>
      1. <i id='Nt2Qm'><tr id='Nt2Qm'><dt id='Nt2Qm'><q id='Nt2Qm'><span id='Nt2Qm'><b id='Nt2Qm'><form id='Nt2Qm'><ins id='Nt2Qm'></ins><ul id='Nt2Qm'></ul><sub id='Nt2Qm'></sub></form><legend id='Nt2Qm'></legend><bdo id='Nt2Qm'><pre id='Nt2Qm'><center id='Nt2Qm'></center></pre></bdo></b><th id='Nt2Qm'></th></span></q></dt></tr></i><div id='Nt2Qm'><tfoot id='Nt2Qm'></tfoot><dl id='Nt2Qm'><fieldset id='Nt2Qm'></fieldset></dl></div>
          <tbody id='Nt2Qm'></tbody>

                <bdo id='Nt2Qm'></bdo><ul id='Nt2Qm'></ul>

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

              • <legend id='Nt2Qm'><style id='Nt2Qm'><dir id='Nt2Qm'><q id='Nt2Qm'></q></dir></style></legend>

                1. 本文介绍了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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文章

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

                      <bdo id='ZeVKH'></bdo><ul id='ZeVKH'></ul>

                      <tfoot id='ZeVKH'></tfoot>

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