// SetCookies sets the Cookies field's value.
968276
func (s *ForwardedValues) SetCookies(v *CookiePreference) *ForwardedValues {
	s.Cookies = v
	return s
}
195089
func (state *UserState) SetUsernameCookie(w http.ResponseWriter, username string) error {
	if username == "" {
		return errors.New("Can't set cookie for empty username")
	}
	if !state.HasUser(username) {
		return errors.New("Can't store cookie for non-existing user")
	}
	// Create a cookie that lasts for a while ("timeout" seconds),
	// this is the equivalent of a session for a given username.
	cookie.SetSecureCookiePath(w, "user", username, state.cookieTime, "/", state.cookieSecret)
	return nil
}
212203
func (ctx *Context) SecureCookies(secret string) Cookies {
	return &secureCookies{
		(*cookies)(ctx),
		secret,
	}
}
82892
func (s *ApiKey) SetExpires(v int64) *ApiKey {
	s.Expires = &v
	return s
}
844725
func (self *HttpClient) SetCookieJar(jar http.CookieJar) {
	self.client.Jar = jar
}
626457
func (s *CreateDevicePoolInput) SetRules(v []*Rule) *CreateDevicePoolInput {
	s.Rules = v
	return s
}
221601
func (s *Group) SetKeys(v []*string) *Group {
	s.Keys = v
	return s
}
461777
func (gr *GoReq) AddCookies(cookies []*http.Cookie) *GoReq {
	gr.Cookies = append(gr.Cookies, cookies...)
	return gr
}
1158269
func (s *GetObjectOutput) SetExpires(v string) *GetObjectOutput {
	s.Expires = &v
	return s
}
1025704
func SetUserCookie(w http.ResponseWriter, r *http.Request, user User) {

	cookie := &http.Cookie{
		Name:     Config.CookieName,
		Path:     "/",
		Domain:   r.URL.Host,
		HttpOnly: Config.CookieHttpOnly,
		Secure:   Config.CookieSecure,
	}

	// if not a session cookie set the MaxAge
	if Config.CookieMaxAge > 0 {
		cookie.MaxAge = Config.CookieMaxAge
	}

	SetUserCookieOpts(w, cookie, user)
}
517263
func (s *CopyObjectInput) SetExpires(v time.Time) *CopyObjectInput {
	s.Expires = &v
	return s
}
694909
func (s *DescribeSessionsOutput) SetSessions(v []*Session) *DescribeSessionsOutput {
	s.Sessions = v
	return s
}
791420
func (d *domainClient) SetCookie(ctx context.Context, args *SetCookieArgs) (reply *SetCookieReply, err error) {
	reply = new(SetCookieReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "Network.setCookie", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "Network.setCookie", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "Network", Op: "SetCookie", Err: err}
	}
	return
}
938424
func (c *cookies) Set(ck *http.Cookie) {
	http.SetCookie(c.ResponseWriter, ck)
}
1372525
func (c *Collector) SetCookies(URL string, cookies []*http.Cookie) error {
	if c.backend.Client.Jar == nil {
		return ErrNoCookieJar
	}
	u, err := url.Parse(URL)
	if err != nil {
		return err
	}
	c.backend.Client.Jar.SetCookies(u, cookies)
	return nil
}
451081
func DeleteCookies(w http.ResponseWriter, cookieNames ...string) {
	for _, n := range cookieNames {
		c := &http.Cookie{
			Name:    n,
			Value:   "",
			Path:    "/",
			MaxAge:  -1,
			Expires: time.Time{},
		}
		http.SetCookie(w, c)
	}
}
674423
func (c *Context) SetCookie(
	name string,
	value string,
	maxAge int,
	path string,
	domain string,
	secure bool,
	httpOnly bool,
) {
	if path == "" {
		path = "/"
	}
	http.SetCookie(c.Writer, &http.Cookie{
		Name:     name,
		Value:    url.QueryEscape(value),
		MaxAge:   maxAge,
		Path:     path,
		Domain:   domain,
		Secure:   secure,
		HttpOnly: httpOnly,
	})
}