久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

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

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

        如何從 Ajax 調(diào)用修改 Cookie

        How to modify Cookie from Ajax call(如何從 Ajax 調(diào)用修改 Cookie)
        <tfoot id='rrP50'></tfoot>
          <tbody id='rrP50'></tbody>
            • <small id='rrP50'></small><noframes id='rrP50'>

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

            • <legend id='rrP50'><style id='rrP50'><dir id='rrP50'><q id='rrP50'></q></dir></style></legend>
                  <bdo id='rrP50'></bdo><ul id='rrP50'></ul>
                  本文介紹了如何從 Ajax 調(diào)用修改 Cookie的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有這個(gè)代碼:

                  window.onload = function() {
                          document.cookie = 'foo=bar; expires=Sun, 01 Jan 2012 00:00:00 +0100; path=/';
                          var xhr = new XMLHttpRequest();
                          xhr.open("GET", "/showcookie.php",true);
                          xhr.setRequestHeader("Cookie", "foo=quux");
                  
                          xhr.setRequestHeader("Foo", "Bar");
                          xhr.setRequestHeader("Foo", "Baz");
                  
                          xhr.withCredentials = true;
                          var pre = document.getElementById('output');
                          xhr.onreadystatechange = function() {
                              if (4 == xhr.readyState) {
                                  pre.innerHTML += xhr.responseText + "
                  ";
                              }
                          };
                          xhr.send(null);
                      };
                  

                  還有這個(gè)/showcookie.php

                  and this /showcookie.php

                  <?php
                  
                  print_r($_COOKIE);
                  
                  ?>
                  

                  它總是顯示

                  Array
                  (
                      [Host] => localhost
                      [User-Agent] => 
                      [Accept] => 
                      [Accept-Language] => pl,en-us;q=0.7,en;q=0.3
                      [Accept-Encoding] => gzip,deflate
                      [Accept-Charset] => ISO-8859-2,utf-8;q=0.7,*;q=0.7
                      [Keep-Alive] => 115
                      [Connection] => keep-alive
                      [foo] => Baz
                      [Referer] =>
                      [Cookie] => foo=bar
                  )
                  
                  Array
                  (
                      [foo] => bar
                  )
                  

                  我在 Ubuntu 上使用 Firefox 3.6.13、Opera 11.00 和 Chromium 9.0.

                  I'm using Firefox 3.6.13, Opera 11.00 and Chromium 9.0 on Ubuntu.

                  有沒有人有同樣的問題,或者無法修改 Cookie 標(biāo)頭.

                  Is anybody have the same problem or maybe it's impossible to modify Cookie header.

                  推薦答案

                  Cookie 標(biāo)頭是 XMLHttpRequest 中無法修改的幾個(gè)標(biāo)頭之一.來自規(guī)范:

                  The Cookie header is one of several which cannot be modified in an XMLHttpRequest. From the specification:

                  終止[執(zhí)行setRequestHeader方法]如果header是一個(gè)不區(qū)分大小寫的匹配項(xiàng)之一以下標(biāo)題:

                  Terminate [execution of the setRequestHeader method] if header is a case-insensitive match for one of the following headers:

                  • 接受字符集
                  • 接受編碼
                  • 連接
                  • 內(nèi)容長(zhǎng)度
                  • Cookie
                  • Cookie2
                  • 內(nèi)容傳輸編碼
                  • 日期
                  • 期待
                  • 主持人
                  • 保持活躍
                  • 推薦人
                  • TE
                  • 預(yù)告片
                  • 傳輸編碼
                  • 升級(jí)
                  • 用戶代理
                  • 通過

                  ... 或者如果標(biāo)題的開頭是代理的不區(qū)分大小寫匹配 - 或Sec- (包括當(dāng)標(biāo)題只是Proxy-或Sec-).

                  … or if the start of header is a case-insensitive match for Proxy- or Sec- (including when header is just Proxy- or Sec-).

                  以上標(biāo)題由用戶代理讓它控制那些運(yùn)輸方面.這保證數(shù)據(jù)完整性在一定程度上.標(biāo)題以 Sec- 開頭的名稱不是允許設(shè)置為允許新標(biāo)頭保證不會(huì)被鑄造來自 XMLHttpRequest.

                  The above headers are controlled by the user agent to let it control those aspects of transport. This guarantees data integrity to some extent. Header names starting with Sec- are not allowed to be set to allow new headers to be minted that are guaranteed not to come from XMLHttpRequest.

                  這篇關(guān)于如何從 Ajax 調(diào)用修改 Cookie的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會(huì)等待 ajax 調(diào)用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請(qǐng)求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請(qǐng)求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)

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

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

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

                          <bdo id='wheYQ'></bdo><ul id='wheYQ'></ul>
                            <tbody id='wheYQ'></tbody>
                            主站蜘蛛池模板: 久久精品国内 | 精品国产乱码一区二区三区 | 黄色成人免费看 | 国产高清视频在线播放 | 国产一区二区在线播放视频 | 操视频网站 | 综合网在线 | 久久精品国产免费看久久精品 | 亚洲视频免费观看 | 秋霞在线一区 | 欧美激情久久久 | 久久美女视频 | 亚洲一区 | 免费观看色| 欧美中文字幕一区二区 | 日韩播放| 欧美黄色录像 | 综合色婷婷| 亚洲午夜电影 | 丁香五月缴情综合网 | 女同久久另类99精品国产 | 亚洲精品乱码久久久久久按摩观 | 欧美三级视频在线观看 | 久久久久久国产 | 日韩中文字幕免费在线观看 | 国产农村一级片 | 激情五月婷婷丁香 | 成人国产免费观看 | 中文在线a在线 | 欧美在线观看网站 | 国产精品一区在线观看你懂的 | 亚洲一二三区在线观看 | 国产精品久久久久久久午夜片 | 99re66在线观看精品热 | 亚洲精品在线国产 | 亚洲成人自拍 | 国产免费视频 | 精品久久久久国产免费第一页 | 日韩在线小视频 | 国产精品麻 | 久久国产精品网 |