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. Advertisements

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. Alex Nitulescu

    Response.Cookies vs Request.Cookies

    Alex Nitulescu, Feb 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    9,355
    Hans Kesting
    Feb 3, 2005
  2. Andy Fish
    Replies:
    3
    Views:
    6,856
    Fredrik Lindner
    Nov 6, 2003
  3. user
    Replies:
    3
    Views:
    844
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Mar 31, 2007
  4. _Who
    Replies:
    7
    Views:
    3,134
  5. Guest

    Webrick and Cookies

    Guest, Jun 23, 2004, in forum: Ruby
    Replies:
    2
    Views:
    610
    gabriele renzi
    Jun 23, 2004
  6. Lloyd Zusman
    Replies:
    2
    Views:
    629
  7. Aaron Smith

    WEBrick cookies not persisting?

    Aaron Smith, Jan 19, 2007, in forum: Ruby
    Replies:
    1
    Views:
    208
    Aaron Patterson
    Jan 19, 2007
  8. Aaron Smith

    WEBrick::Daemon and WEBrick

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