From: Brian Candler Date: 2003-07-15T06:48:19+09:00 Subject: Re: Ruby CGI questions On Tue, Jul 15, 2003 at 06:11:53AM +0900, Kurt M. Dresner wrote: > I'm trying to make a game (or at least something, so I can learn) with > Ruby CGI. I'm having a really hard time with sessions. I have some > variables that I want to save, but they are not strings. They are > classes that I have defined. Is there any way to save them with a > session without them just being converted to strings and then being read > back in as strings when I load the session up? I haven't used the CGI::Session module, but you may or may not be aware of Marshal which can convert (almost) any object into a string representation and back again. So perhaps all you're looking for is: sess["deck"] = Marshal.dump(deck) and deck = Marshal.load(sess["deck"]) (although it's not clear to me why CGI::Session doesn't do that for you) Regards, Brian.