Re: mod_ruby Apache::* tutorial

Mat Schaffer <[email protected]> Fri, 2 Jun 2006 12:36:20 -0400
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
On Jun 2, 2006, at 11:37 AM, Kirk Haines wrote:
> Cookies are pretty simple to deal with.
>
> On your outgoing HTTP headers, just create a 'Set-Cookie' header  
> with the
> contents of the cookie for the value.
>
> request.headers_out['Set-Cookie']="user_id=#{@useridx}/#{@confkey};  
> path=/"
>
> To read cookies, just pull them out of the Cookie header on the  
> incoming http
> headers:
>
> request.headers_in['Cookie'].split(';').each do |cookie|
>   k,v = cookie.split(C_equal)
>   k.strip!
>   v.strip!
>   @cookies[k] = v
> end
>
> That's the nutshell version of setting and getting cookies.

Is there anyone working on a cleaner way to access these things?   
Having to do cookies via manual header lines is a pretty significant  
barrier to entry, IMHO.

I like the way rails these things, but I know my initial experiences  
were tough because of the sheer size of it all.  I would bet I'm not  
the only one.
I'd like to help out with any efforts to make programming with  
mod_ruby/eRuby easy, but I'd like to make sure I don't duplicate work  
that's already be done.
-Mat