webrick & cookies

Discussion in 'Ruby' started by Navindra Umanee, Feb 26, 2005.

  1. Wishlist item, I guess:

    Wouldn't it have been nicer if Webrick stored cookies as a hash keyed
    on the name of the cookie instead of as a plain array?

    That is, it would have been cool if you could have done
    response.cookies['name'] to get the value you're interested in.
    Instead you have to traverse a list of cookies and/or convert it to a
    hash first.

    Looking at httprequest.rb, it wouldn't have been too much effort to
    create a hash instead of an array:

    @header['cookie'].each{|cookie|
    @cookies += Cookie::parse(cookie)
    }

    Cheers,
    Navin.
     
    Navindra Umanee, Feb 26, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. _Who
    Replies:
    7
    Views:
    2,686
  2. Guest

    Webrick and Cookies

    Guest, Jun 23, 2004, in forum: Ruby
    Replies:
    2
    Views:
    268
    gabriele renzi
    Jun 23, 2004
  3. Lloyd Zusman
    Replies:
    2
    Views:
    404
  4. Aaron Smith

    WEBrick cookies not persisting?

    Aaron Smith, Jan 19, 2007, in forum: Ruby
    Replies:
    1
    Views:
    122
    Aaron Patterson
    Jan 19, 2007
  5. Aaron Smith

    WEBrick::Daemon and WEBrick

    Aaron Smith, Mar 9, 2007, in forum: Ruby
    Replies:
    2
    Views:
    318
    Aaron Smith
    Mar 18, 2007
Loading...

Share This Page