<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                > cookie通常用于在瀏覽器中保存一些小數據,例如客戶標識、用戶非銘感數據。注意別使用cookie保存隱私數據。 > gin框架主要通過上下文對象提供的SetCookie()和Cookie()兩個函數操作cookie ~~~ package main import ( "github.com/gin-gonic/gin" ) func main() { router := gin.Default() // 設置 cookiesite_cookie router.GET("/setCookie", func(c *gin.Context) { c.SetCookie("site_cookie", "www.xx.com", 3600, "/", "localhost", false, true) c.String(200, "done") }) // 讀取 cookie router.GET("/getCookie", func(c *gin.Context) { data, err := c.Cookie("site_cookie") if err != nil { c.String(200,"not found!") return } // 直接返回cookie值 c.String(200,data) }) // 刪除 cookie:將MaxAge設置為-1,表示刪除 router.GET("/delCookie", func(c *gin.Context) { c.SetCookie("site_cookie", "", -1, "/", "localhost", false, true) c.String(200,"cookie已刪除") }) router.Run(":8080") } ~~~ **SetCookie函數定義** > `func (c *Context) SetCookie(name, value string, maxAge int, path, domain string, secure, httpOnly bool)` > 參數說明: ![](https://img.kancloud.cn/f2/c5/f2c5f5465e81f66eeb630068957ed6a8_1275x325.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看