Method: Rack::Utils.add_cookie_to_header

Defined in:
lib/rack/utils.rb

243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/rack/utils.rb', line 243

def add_cookie_to_header(header, key, value)
  warn("add_cookie_to_header is deprecated and will be removed in Rack 3.1", uplevel: 1)

  case header
  when nil, ''
    return set_cookie_header(key, value)
  when String
    [header, set_cookie_header(key, value)]
  when Array
    header + [set_cookie_header(key, value)]
  else
    raise ArgumentError, "Unrecognized cookie header value. Expected String, Array, or nil, got #{header.inspect}"
  end
end