From: Doug Jolley Date: 2012-08-02T01:01:51+09:00 Subject: Re: How to test whether a session variable has a particular key > Anyway, if you can avoid storing nil values, then I'd just use > > if session[:key] > ... do something > end Interestingly, it seems that I am UNABLE to assign a nil value to a session element. That's disappointing because it would have been handy to treat elements with a nil value as non-existent since there is no way to remove an element from the pseudo hash. Note: The above is within the context of CGI::Session. ... doug -- Posted via http://www.ruby-forum.com/.