From: Frank Fejes Date: 2003-03-07T06:34:17+09:00 Subject: Re: cookies in eruby mod_ruby On Fri, 07 Mar 2003 05:17:20 +0900, Daniel Bretoi wrote: > On Fri, Mar 07, 2003 at 01:33:29AM +0900, Frank Fejes wrote: >> ERuby.noheader will tell eruby to not output headers on its own since >> we'll want to write them yourself. Later on in the script for the headers >> display you will need to replace that portion too since, again, the Apache >> object is not around in cgi land. > > If I leave it with it's own headers, will it be interfering with mine? I believe it will, however check it for yourself. Either way, you don't need this new block since you'll be running with mod_ruby and can use the Apache request object. >> Either way, the original message should be just fine since you wanted >> mod_ruby assistance in the first place. ;) > > > Indeed :) One more question, expiration and deletion? My first post explained how to delete: > to delete a cookie you'd just set another cookie with the same > variable and path but with an expiration date in the past. For expiration, you need to use the rfc 1123 date format. I require 'cgi' since it includes the very useful CGI::rfc1123_date class method. It converts a Time instance into the format that the cookie string uses. From my first post: > ed = CGI.rfc1123_date(Time.now + (60 * 60 * 24 * 365)) That will return a date string of one year from now (60 seconds * 60 minutes * 24 hours * 365 days). If you want an expiration date in the past, just do something like: ed = CGI.rfc1123_date(Time.now - (60 * 60 * 24 * 365)) Have fun! --frank