From: dmcnulty@... (Dan McNulty) Date: 2002-02-22T00:18:46+09:00 Subject: Re: dang it, CGI::Session is broken again Well I found out a problem here. I set Mozilla to notify me when any cookie requests are sent, and my application isn't sending out a cookie! Doesn't CGI::Session use cookies to store the data on the client side? I am pretty sure it does, but then why isn't this part happening? The temp files are being created on the server side (my /tmp directory has several hundred "rubysess.*" files in it :-) ) and they contain the appropriate info. I cannot locate any such files on the client side, and Mozilla doesn't pop up a window asking me to confirm acceptance of a cookie. If I go to other "real" websites, I do get the confirmation window. If anyone has a clue as to why this is happening, please let me know. -- Dan dmcnulty@mindspring.com (Dan McNulty) wrote in message news:... > What is wrong with this? I swear this was working yesterday, but now > its broken. I have a feeling something changed in my environment, and > that this will work as expected for others...perhaps the web gods have > cursed me, and I am destined for a future of never-working code :-( > > For me, after rerunning this program sess["junk"] is always "nil". > The session is never restored. > > I am sorry for bringing this subject up again, but this is absolutely > maddening! > > ---------------------------------------------------- > #!/usr/bin/ruby > > require "cgi" > require "cgi/session" > > cgi = CGI.new > > sess = CGI::Session.new(cgi, > "session_key" => "a_test", > "prefix" => "rubysess.") > > if sess["junk"]==nil > print "A new session ", "junk is ", sess["junk"], "\n" > sess["junk"]=123 > print "A new session ", "junk is now ", sess["junk"], "\n" > sess.close > else > print "An existing session", "junk is ", sess["junk"], "\n" > sess["junk"]=sess["junk"].to_i + 1 > print "An existing session", "junk is now ", sess["junk"], "\n" > sess.close > end > -------------------------------------------------------