Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for setCookies (0.29 sec)

  1. src/net/http/jar.go

    // goroutines.
    //
    // The net/http/cookiejar package provides a CookieJar implementation.
    type CookieJar interface {
    	// SetCookies handles the receipt of the cookies in a reply for the
    	// given URL.  It may or may not choose to save the cookies, depending
    	// on the jar's policy and implementation.
    	SetCookies(u *url.URL, cookies []*Cookie)
    
    	// Cookies returns the cookies to send in a request for the given URL.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 900 bytes
    - Viewed (0)
  2. src/net/http/cookiejar/jar.go

    	}
    
    	return cookies
    }
    
    // SetCookies implements the SetCookies method of the [http.CookieJar] interface.
    //
    // It does nothing if the URL's scheme is not HTTP or HTTPS.
    func (j *Jar) SetCookies(u *url.URL, cookies []*http.Cookie) {
    	j.setCookies(u, cookies, time.Now())
    }
    
    // setCookies is like SetCookies but takes the current time as parameter.
    func (j *Jar) setCookies(u *url.URL, cookies []*http.Cookie, now time.Time) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 15K bytes
    - Viewed (0)
  3. src/net/http/cookiejar/jar_test.go

    	// Populate jar with cookies.
    	setCookies := make([]*http.Cookie, len(test.setCookies))
    	for i, cs := range test.setCookies {
    		cookies := (&http.Response{Header: http.Header{"Set-Cookie": {cs}}}).Cookies()
    		if len(cookies) != 1 {
    			panic(fmt.Sprintf("Wrong cookie line %q: %#v", cs, cookies))
    		}
    		setCookies[i] = cookies[0]
    	}
    	jar.setCookies(mustParseURL(test.fromURL), setCookies, now)
    	now = now.Add(1001 * time.Millisecond)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 34K bytes
    - Viewed (0)
  4. src/net/http/client_test.go

    }
    
    var echoCookiesRedirectHandler = HandlerFunc(func(w ResponseWriter, r *Request) {
    	for _, cookie := range r.Cookies() {
    		SetCookie(w, cookie)
    	}
    	if r.URL.Path == "/" {
    		SetCookie(w, expectedCookies[1])
    		Redirect(w, r, "/second", StatusMovedPermanently)
    	} else {
    		SetCookie(w, expectedCookies[2])
    		w.Write([]byte("hello"))
    	}
    })
    
    func TestClientSendsCookieFromJar(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:30:50 UTC 2024
    - 63.8K bytes
    - Viewed (0)
  5. src/net/http/client.go

    		}
    	}
    	resp, didTimeout, err = send(req, c.transport(), deadline)
    	if err != nil {
    		return nil, didTimeout, err
    	}
    	if c.Jar != nil {
    		if rc := resp.Cookies(); len(rc) > 0 {
    			c.Jar.SetCookies(req.URL, rc)
    		}
    	}
    	return resp, nil, nil
    }
    
    func (c *Client) deadline() time.Time {
    	if c.Timeout > 0 {
    		return time.Now().Add(c.Timeout)
    	}
    	return time.Time{}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 06:06:11 UTC 2024
    - 33.7K bytes
    - Viewed (0)
  6. src/net/http/httputil/reverseproxy_test.go

    	}
    	if g, e := len(res.Header["X-Multi-Value"]), 2; g != e {
    		t.Errorf("got %d X-Multi-Value header values; expected %d", g, e)
    	}
    	if g, e := len(res.Header["Set-Cookie"]), 1; g != e {
    		t.Fatalf("got %d SetCookies, want %d", g, e)
    	}
    	if g, e := res.Trailer, (http.Header{"X-Trailer": nil}); !reflect.DeepEqual(g, e) {
    		t.Errorf("before reading body, Trailer = %#v; want %#v", g, e)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 54.6K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/internal.kt

    import okhttp3.internal.concurrent.TaskRunner
    import okhttp3.internal.connection.RealConnection
    
    internal fun parseCookie(
      currentTimeMillis: Long,
      url: HttpUrl,
      setCookie: String,
    ): Cookie? = Cookie.parse(currentTimeMillis, url, setCookie)
    
    internal fun cookieToString(
      cookie: Cookie,
      forObsoleteRfc2965: Boolean,
    ): String = cookie.toString(forObsoleteRfc2965)
    
    internal fun addHeaderLenient(
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/Cookie.kt

         * [setCookie] is not a well-formed cookie.
         */
        @JvmStatic
        fun parse(
          url: HttpUrl,
          setCookie: String,
        ): Cookie? = parse(System.currentTimeMillis(), url, setCookie)
    
        internal fun parse(
          currentTimeMillis: Long,
          url: HttpUrl,
          setCookie: String,
        ): Cookie? {
    Registered: Sun Jun 16 04:42:17 UTC 2024
    - Last Modified: Sat Apr 06 04:12:05 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  9. src/net/http/cookiejar/example_test.go

    	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    		if cookie, err := r.Cookie("Flavor"); err != nil {
    			http.SetCookie(w, &http.Cookie{Name: "Flavor", Value: "Chocolate Chip"})
    		} else {
    			cookie.Value = "Oatmeal Raisin"
    			http.SetCookie(w, cookie)
    		}
    	}))
    	defer ts.Close()
    
    	u, err := url.Parse(ts.URL)
    	if err != nil {
    		log.Fatal(err)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 03:47:00 UTC 2016
    - 1.5K bytes
    - Viewed (0)
  10. src/main/java/org/codelibs/fess/helper/RoleQueryHelper.java

            }
    
        }
    
        protected void processCookie(final HttpServletRequest request, final Set<String> roleSet) {
    
            final Cookie[] cookies = request.getCookies();
            if (cookies != null) {
                for (final Cookie cookie : cookies) {
                    if (cookieKey.equals(cookie.getName())) {
                        final String value = cookie.getValue();
    Registered: Wed Jun 12 13:08:18 UTC 2024
    - Last Modified: Thu Feb 22 01:37:57 UTC 2024
    - 11.5K bytes
    - Viewed (0)
Back to top