From: Jeremy Kemper Date: 2007-02-25T05:25:43+09:00 Subject: Re: Problem with session under cgi file. ------=_Part_68632_30826462.1172348740476 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 2/24/07, ara.t.howard@noaa.gov wrote: > > On Sun, 25 Feb 2007, Dsa Dang wrote: > > >> you need to make sure you flush and close it. > > > > I've added sess.close at the end but it still doesn't work :/ > > > > > are you setting the expiration? > > cgi = CGI.new > > session = CGI::Session.new(cgi, "session_expires" => Time.at(2**31-1)) > at_exit{ session.update; session.close } Good suggestions, but both should be unnecessary. CGI::Session uses a finalizer to ensure the session is closed and all the builtin session stores update on close. No expires means the cookie lives for the duration of the browser session. Your source suggested you may be sending a malformed HTTP response. Inspect the request and response in Firebug to see: look for the Set-Cookie header in the response and the Cookie header in subsequent requests. jeremy ------=_Part_68632_30826462.1172348740476--